From dad06c7561d6f0ca0ea8d7f104ade04ab0e051fd Mon Sep 17 00:00:00 2001 From: Bert Date: Mon, 12 Sep 2011 19:28:02 +0200 Subject: Much nicer handling of compile-time features - *_SUPPORT enabled in config.h - XLIBS helper app prints lib flags needed for current settings --- Makefile | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f1337b4..dd1c87b 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,6 @@ CFLAGS = -Wall -pedantic -O2 LDFLAGS = LIBS = -lX11 -lImlib2 -XFLAGS = -XLIBS = - -DESTDIR = PREFIX = /usr/local MANPREFIX = $(PREFIX)/share/man @@ -22,33 +18,34 @@ options: @echo "CC = $(CC)" @echo "CFLAGS = $(CFLAGS)" @echo "LDFLAGS = $(LDFLAGS)" - @echo "XFLAGS = $(XFLAGS)" - @echo "XLIBS = $(XLIBS)" @echo "PREFIX = $(PREFIX)" .c.o: @echo "CC $<" - @$(CC) $(CFLAGS) $(XFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $< + @$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $< + +$(OBJ) XLIBS: Makefile config.h -$(OBJ): Makefile config.h +XLIBS: XLIBS.c + @$(CC) $(CFLAGS) -o $@ $@.c config.h: @echo "creating $@ from config.def.h" @cp config.def.h $@ -sxiv: $(OBJ) +sxiv: $(OBJ) XLIBS @echo "CC -o $@" - @$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(XLIBS) + @$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $$(./XLIBS) clean: @echo "cleaning" - @rm -f $(OBJ) sxiv sxiv-$(VERSION).tar.gz + @rm -f $(OBJ) XLIBS sxiv sxiv-$(VERSION).tar.gz dist: clean @echo "creating dist tarball" @mkdir -p sxiv-$(VERSION) - @cp LICENSE Makefile Makefile.netbsd README.md config.def.h \ - sxiv.1 $(SRC) sxiv-$(VERSION) + @cp LICENSE Makefile README.md config.def.h sxiv.1 $(SRC) XLIBS.c \ + sxiv-$(VERSION) @tar -cf sxiv-$(VERSION).tar sxiv-$(VERSION) @gzip sxiv-$(VERSION).tar @rm -rf sxiv-$(VERSION) -- cgit v1.2.3