tinywebd
annotate Makefile @ 17:2874f61a43b1
implementing the directory index generation
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 21 Apr 2015 04:33:02 +0300 |
parents | 0dd50a23f3dd |
children |
rev | line source |
---|---|
nuclear@15 | 1 PREFIX = /usr/local |
nuclear@15 | 2 |
nuclear@0 | 3 src = $(wildcard src/*.c) |
nuclear@0 | 4 obj = $(src:.c=.o) |
nuclear@0 | 5 dep = $(obj:.o=.d) |
nuclear@0 | 6 bin = tinywebd |
nuclear@10 | 7 weblib = libtinyweb/libtinyweb.so |
nuclear@0 | 8 |
nuclear@10 | 9 CFLAGS = -pedantic -Wall -g -Ilibtinyweb/src |
nuclear@10 | 10 LDFLAGS = -Llibtinyweb -Wl,-rpath=libtinyweb -ltinyweb |
nuclear@0 | 11 |
nuclear@10 | 12 $(bin): $(obj) $(weblib) |
nuclear@0 | 13 $(CC) -o $@ $(obj) $(LDFLAGS) |
nuclear@0 | 14 |
nuclear@15 | 15 .PHONY: $(weblib) |
nuclear@10 | 16 $(weblib): |
nuclear@15 | 17 $(MAKE) -C libtinyweb PREFIX=$(PREFIX) |
nuclear@10 | 18 |
nuclear@0 | 19 -include $(dep) |
nuclear@0 | 20 |
nuclear@0 | 21 %.d: %.c |
nuclear@0 | 22 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@0 | 23 |
nuclear@0 | 24 .PHONY: clean |
nuclear@0 | 25 clean: |
nuclear@0 | 26 rm -f $(obj) $(bin) |
nuclear@10 | 27 |
nuclear@10 | 28 .PHONY: install |
nuclear@10 | 29 install: $(bin) |
nuclear@10 | 30 mkdir -p $(PREFIX)/bin |
nuclear@10 | 31 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin) |
nuclear@15 | 32 $(MAKE) -C libtinyweb PREFIX=$(PREFIX) install |
nuclear@10 | 33 |
nuclear@10 | 34 .PHONY: uninstall |
nuclear@10 | 35 uninstall: |
nuclear@10 | 36 rm -f $(DESTDIR)$(PREFIX)/bin/$(bin) |