tinywebd

view Makefile @ 15:4a25751fe61d

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