# Makefile for the nwho toolkit
-CFLAGS=-O2 -Wall -Wno-parentheses
+CFLAGS=-O2 -Wall -Wextra -Wno-parentheses -DVERSION=$(VERSION) -std=gnu99
LDFLAGS=-s
ROOT=/
-REL=nwho-1.10
+VERSION=1.15
+ARCHIVE=nwho-$(VERSION).tar.gz
all: nwhod nwho
-nwhod: nwhod.o
+nwhod: nwhod.o util.o
+nwhod.o: nwhod.c nwho.h
+util.o: util.c nwho.h
-nwhod.o: nwhod.c net.h
-
-nwho: nwho.o
-
-nwho.o: nwho.c net.h
+nwho: nwho.o util.o
+nwho.o: nwho.c nwho.h
clean:
rm -f *.o nwhod nwho *~
install -s -m 755 nwho $(ROOT)/usr/bin
ln -sf nwho $(ROOT)/usr/bin/nuptime
install -s -m 755 nwhod $(ROOT)/usr/sbin
- install -d -m 755 $(ROOT)/var/spool/nwho
-
-dist: clean
- mkdir -p ~/tmp
- cp -a . ~/tmp/$(REL)
- rm -rf `find ~/tmp/$(REL) -name CVS -o -name tmp`
- cd ~/tmp ; tar czvvf $(REL).tar.gz $(REL)
- rm -rf ~/tmp/$(REL)
+ install -d -m 755 $(ROOT)/var/state/nwho
+
+release:
+ git tag v$(VERSION)
+ git push --tags
+ git archive --format=tar --prefix=nwho-$(VERSION)/ HEAD | gzip >$(ARCHIVE)
+ scp $(ARCHIVE) atrey:~ftp/pub/local/mj/linux/
+ ssh jw "cd www && bin/release-prog nwho $(VERSION)"
+ mv $(ARCHIVE) ~/archives/sw/nwho/