mediatools/Makefile

54 lines
1.3 KiB
Makefile
Raw Normal View History

2020-02-04 23:32:59 +00:00
RM := rm -f
CFLAGS := -O3 -Wall -Isrc -I/usr/include/ffmpeg
2021-10-24 01:30:05 +00:00
LIBS := -lavformat -lavutil -lavcodec -lswscale -lrsvg-2
2020-02-04 23:32:59 +00:00
LDFLAGS :=
INSTALL ?= install
PREFIX ?= /usr/local
COMMON_OBJECTS := build/validation.o build/png.o build/util.o
2020-02-04 23:32:59 +00:00
MEDIASTAT_OBJECTS := build/stat.o
2021-10-24 01:30:05 +00:00
SVGSTAT_OBJECTS := build/svgstat.o
2020-05-19 00:37:19 +00:00
MEDIATHUMB_OBJECTS := build/thumb.o
2020-02-04 23:32:59 +00:00
# Phony rules
.PHONY: all mediastat clean
2021-10-24 01:30:05 +00:00
all: mediastat svgstat mediathumb
2020-02-04 23:32:59 +00:00
install: all
$(INSTALL) build/mediastat $(PREFIX)/bin/mediastat
2021-10-24 01:30:05 +00:00
$(INSTALL) build/svgstat $(PREFIX)/bin/svgstat
2020-05-19 00:37:19 +00:00
$(INSTALL) build/mediathumb $(PREFIX)/bin/mediathumb
2020-02-04 23:32:59 +00:00
uninstall:
$(RM) -rf $(PREFIX)/bin/mediastat
2021-10-24 01:30:05 +00:00
$(RM) -rf $(PREFIX)/bin/svgstat
2020-05-19 00:37:19 +00:00
$(RM) -rf $(PREFIX)/bin/mediathumb
2020-02-04 23:32:59 +00:00
mediastat: build/mediastat
2021-10-24 01:30:05 +00:00
svgstat: build/svgstat
2020-05-19 00:37:19 +00:00
mediathumb: build/mediathumb
2020-02-04 23:32:59 +00:00
clean:
2021-10-24 01:30:05 +00:00
$(RM) $(COMMON_OBJECTS) $(MEDIASTAT_OBJECTS) $(SVGSTAT_OBJECTS) $(MEDIATHUMB_OBJECTS)
2020-02-04 23:32:59 +00:00
# Build rules
build/mediastat: $(COMMON_OBJECTS) $(MEDIASTAT_OBJECTS)
$(CC) $^ $(LDFLAGS) $(LIBS) -o $@
2021-10-24 01:30:05 +00:00
build/svgstat: $(COMMON_OBJECTS) $(SVGSTAT_OBJECTS)
$(CC) $^ $(LDFLAGS) $(LIBS) -o $@
2020-05-19 00:37:19 +00:00
build/mediathumb: $(COMMON_OBJECTS) $(MEDIATHUMB_OBJECTS)
$(CC) $^ $(LDFLAGS) $(LIBS) -o $@
2020-02-04 23:32:59 +00:00
build/%.o: src/%.c
$(CC) $(CFLAGS) -MMD -c $< -o $@
# Declare dependencies
-include $(COMMON_OBJECTS:.o=.d)
-include $(MEDIASTAT_OBJECTS:.o=.d)
2021-10-24 01:30:05 +00:00
-include $(SVGSTAT_OBJECTS:.o=.d)