diff options
author | Bert <ber.t@gmx.com> | 2011-09-12 19:28:02 +0200 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-09-12 19:28:02 +0200 |
commit | dad06c7561d6f0ca0ea8d7f104ade04ab0e051fd (patch) | |
tree | d2dd7b45aa80c926cc9b895c776c403b2366ea13 /Makefile | |
parent | 32a65201bb2114790d98a73427fab80f41d94b97 (diff) |
Much nicer handling of compile-time features
- *_SUPPORT enabled in config.h
- XLIBS helper app prints lib flags needed for current settings
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -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) |