aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2017-09-08 15:56:55 +0200
committerBert Münnich <ber.t@posteo.de>2017-09-08 16:03:05 +0200
commite46b1fa609b96194633c58bf75df9c88ede44a90 (patch)
tree32791369b6d5882e6f61d648075b6fd46a0e7dfe /Makefile
parentad9955a9cf2200bf00e607da39a226c4c1d45a6b (diff)
Simplify config.mk
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 16 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index bdc770b..f3ca3f1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,22 @@
-VERSION := git-20170906
+VERSION := git-20170908
-.PHONY: clean install uninstall
+.PHONY: all clean install uninstall
.SUFFIXES:
include config.mk
+CPPFLAGS += -DVERSION=\"$(VERSION)\" -DHAVE_GIFLIB=$(HAVE_GIFLIB) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF)
+DEPFLAGS := -MMD -MP
+
+LDLIBS := -lImlib2 -lX11 -lXft
+
+ifneq ($(HAVE_GIFLIB),0)
+ LDLIBS += -lgif
+endif
+ifneq ($(HAVE_LIBEXIF),0)
+ LDLIBS += -lexif
+endif
+
SRC := autoreload_$(AUTORELOAD).c commands.c image.c main.c options.c thumbs.c util.c window.c
DEP := $(SRC:.c=.d)
OBJ := $(SRC:.c=.o)
@@ -16,13 +28,13 @@ $(OBJ): Makefile
-include $(DEP)
%.o: %.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -DVERSION=\"$(VERSION)\" -MMD -MP -c -o $@ $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(DEPFLAGS) -c -o $@ $<
config.h:
cp config.def.h $@
sxiv: $(OBJ)
- $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+ $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS)
clean:
rm -f $(OBJ) $(DEP) sxiv