tinywebd

diff Makefile @ 10:0dd50a23f3dd

separated all the tinyweb functionality out as a library
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 18 Apr 2015 22:47:57 +0300
parents 9c9e24956d99
children 4a25751fe61d
line diff
     1.1 --- a/Makefile	Sat Apr 18 21:36:07 2015 +0300
     1.2 +++ b/Makefile	Sat Apr 18 22:47:57 2015 +0300
     1.3 @@ -2,12 +2,17 @@
     1.4  obj = $(src:.c=.o)
     1.5  dep = $(obj:.o=.d)
     1.6  bin = tinywebd
     1.7 +weblib = libtinyweb/libtinyweb.so
     1.8  
     1.9 -CFLAGS = -pedantic -Wall -g
    1.10 +CFLAGS = -pedantic -Wall -g -Ilibtinyweb/src
    1.11 +LDFLAGS = -Llibtinyweb -Wl,-rpath=libtinyweb -ltinyweb
    1.12  
    1.13 -$(bin): $(obj)
    1.14 +$(bin): $(obj) $(weblib)
    1.15  	$(CC) -o $@ $(obj) $(LDFLAGS)
    1.16  
    1.17 +$(weblib):
    1.18 +	$(MAKE) -C libtinyweb
    1.19 +
    1.20  -include $(dep)
    1.21  
    1.22  %.d: %.c
    1.23 @@ -16,3 +21,12 @@
    1.24  .PHONY: clean
    1.25  clean:
    1.26  	rm -f $(obj) $(bin)
    1.27 +
    1.28 +.PHONY: install
    1.29 +install: $(bin)
    1.30 +	mkdir -p $(PREFIX)/bin
    1.31 +	cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
    1.32 +
    1.33 +.PHONY: uninstall
    1.34 +uninstall:
    1.35 +	rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)