tinywebd

changeset 15:4a25751fe61d

fixed the makefiles
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 19 Apr 2015 04:18:08 +0300
parents 362644b26a44
children 2873d3ec8c78
files Makefile libtinyweb/Makefile
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/Makefile	Sun Apr 19 01:14:24 2015 +0300
     1.2 +++ b/Makefile	Sun Apr 19 04:18:08 2015 +0300
     1.3 @@ -1,3 +1,5 @@
     1.4 +PREFIX = /usr/local
     1.5 +
     1.6  src = $(wildcard src/*.c)
     1.7  obj = $(src:.c=.o)
     1.8  dep = $(obj:.o=.d)
     1.9 @@ -10,8 +12,9 @@
    1.10  $(bin): $(obj) $(weblib)
    1.11  	$(CC) -o $@ $(obj) $(LDFLAGS)
    1.12  
    1.13 +.PHONY: $(weblib)
    1.14  $(weblib):
    1.15 -	$(MAKE) -C libtinyweb
    1.16 +	$(MAKE) -C libtinyweb PREFIX=$(PREFIX)
    1.17  
    1.18  -include $(dep)
    1.19  
    1.20 @@ -26,6 +29,7 @@
    1.21  install: $(bin)
    1.22  	mkdir -p $(PREFIX)/bin
    1.23  	cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
    1.24 +	$(MAKE) -C libtinyweb PREFIX=$(PREFIX) install
    1.25  
    1.26  .PHONY: uninstall
    1.27  uninstall:
     2.1 --- a/libtinyweb/Makefile	Sun Apr 19 01:14:24 2015 +0300
     2.2 +++ b/libtinyweb/Makefile	Sun Apr 19 04:18:08 2015 +0300
     2.3 @@ -30,6 +30,7 @@
     2.4  $(solib): $(obj)
     2.5  	$(CC) -o $@ $(shared) $(obj) $(LDFLAGS)
     2.6  	[ -n "$(soname)" ] && \
     2.7 +		rm -f $(soname) $(ldname) && \
     2.8  		ln -s $(solib) $(soname) && \
     2.9  		ln -s $(soname) $(ldname) || true
    2.10  
    2.11 @@ -57,6 +58,7 @@
    2.12  	cp $(solib) $(DESTDIR)$(PREFIX)/lib/$(solib)
    2.13  	[ -n "$(soname)" ] && \
    2.14  		cd $(DESTDIR)$(PREFIX)/lib && \
    2.15 +		rm -f $(soname) $(ldname) && \
    2.16  		ln -s $(solib) $(soname) && \
    2.17  		ln -s $(soname) $(ldname) || \
    2.18  		true