diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2022-11-14 17:27:27 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2022-11-14 20:59:15 +0200 |
commit | 6f4542fb9ab491912532468766b0f0f4adb0cb67 (patch) | |
tree | cd331209c13dae29f830742f6aa4fa1cf9088014 /Makefile | |
parent | 8c4875c0a4e034c79e2d90018c66736009d85d75 (diff) | |
download | gimp-plugin-img-6f4542fb9ab491912532468766b0f0f4adb0cb67.tar.gz |
Portable Makefile
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 64 |
1 files changed, 25 insertions, 39 deletions
@@ -1,54 +1,40 @@ MAIN = plugin-img GIMPTOOL = gimptool-2.0 -CC = gcc -LD = gcc -CFLAGS = $(shell $(GIMPTOOL) --cflags) \ - -O2 -Wall -Wextra -Wno-attributes \ - -Wno-unused-parameter +GIMP = gimp +CC = cc +LD = cc +CFLAGS = -O2 -Wall -Wextra -LIBS = $(shell $(GIMPTOOL) --libs) - -SRC = $(wildcard *.c) -HDR = $(wildcard *.h) -OBJ = $(subst .c,.o,$(SRC)) - -build: $(MAIN) - -help: - @echo "MAKE targets:" - @echo "" - @echo "build - build plugin" - @echo "install - install plugin" - @echo "" - @echo "indent - beatify sources" - @echo "clean - remove build garbage" - @echo "" - @echo "test - run gimp with samples" - @echo "test-fu - run non-interactively gimp for batch file recoding" - - -install: $(MAIN) - $(GIMPTOOL) --install-bin $(MAIN) - -indent: $(SRC) $(HDR) - indent $(INDENT_OPT) $? - -clean: - rm -f *.o *.i *.s $(MAIN) +SRC = img-load.c img-save.c img-save-dialog.c plugin-img.c +HDR = $(SRC:.c=.h) +OBJ = $(SRC:.c=.o) $(MAIN): $(OBJ) - $(LD) $(OBJ) $(LIBS) -o $@ + $(LD) $(OBJ) `$(GIMPTOOL) --libs` -o $@ -%.o: %.c $(HDR) Makefile - $(CC) -c $(CFLAGS) $< -o $@ +$(OBJ): $(HDR) Makefile +.c.o: + $(CC) `$(GIMPTOOL) --cflags` $(CFLAGS) -c $< -o $@ +.PHONY: test test: install gimp samples/*.img +.PHONY: test-fu test-fu: install img-fu - gimp -i -b - < img-fu + $(GIMP) --no-interface --batch - < img-fu -.PHONY: install build test test-fu indent clean +.PHONY: install +install: $(MAIN) + $(GIMPTOOL) --install-bin $(MAIN) + +.PHONY: uninstall +uninstall: + $(GIMPTOOL) --uninstall-bin $(MAIN) + +.PHONY: clean +clean: + rm -f *.o *.i *.s $(MAIN) |