-# Makefile for YWHO
+# Makefile for the ywho toolkit
-ywho: ywho.c
- gcc -s -N -O2 -m486 -fomit-frame-pointer -Wall -Wno-parentheses ywho.c -o ywho
+CFLAGS=-O2 -m486 -fomit-frame-pointer -Wall -Wno-parentheses -malign-loops=0 -malign-jumps=0 -malign-functions=2
+LDFLAGS=-s
+ROOT=/
+
+all: ywho nwhod nwho
+
+ywho: ywho.o
+
+ywho.o: ywho.c
+
+nwhod: nwhod.o
+
+nwhod.o: nwhod.c net.h
+
+nwho: nwho.o
+
+nwho.o: nwho.c net.h
clean:
- rm *.o ywho
+ rm -f *.o ywho nwhod nwho *~
install:
strip ywho
- mv ywho /usr/local/bin
+ mkdir -p $(ROOT)/usr/bin $(ROOT)/usr/sbin
+ install -s -m 755 ywho 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