1#
2# Makefile for nn release 6.6
3#
4#
5# Before compiling, read the instructions in the file INSTALLATION!
6# It is best to make changes to the variables in this file in config.h
7# --see Step 2.1: Configuration of Makefile.
8#
9# -----------------------------------------------------------------
10#
11#	make all	compile programs
12#	make clean	remove all make'd files from source directory
13#
14# -----------------------------------------------------------------
15#
16# Some alternatives for CPP might be /lib/cpp and $(CC) -P
17# Common values for CFLAGS are '-O -s' or '-g'
18#
19# Use /lib/cpp or /usr/ccs/lib/cpp for CPP on Solaris or SVR4 machines.
20
21CC =		cc
22
23CPP =		$(CC) -E
24#CPP =		/lib/cpp
25#CPP =		/usr/bin/cpp -no-cpp-precomp	# for MacOS X
26
27CFLAGS =	-O # -g -Wall -ansi -pedantic
28#CFLAGS =	-O # -w0 -g3			# for DEC
29
30MAKE =		make
31
32
33SHELL = /bin/sh
34
35all: ymakefile
36	$(MAKE) $(MFLAGS) -f ymakefile all
37
38touch: ymakefile
39	$(MAKE) -f ymakefile -t all
40
41dbg: ymakefile
42	$(MAKE) $(MFLAGS) -f ymakefile nn1
43
44nn: ymakefile
45	$(MAKE) $(MFLAGS) -f ymakefile nn
46
47master: ymakefile
48	$(MAKE) $(MFLAGS) -f ymakefile master
49
50lint: ymakefile
51	$(MAKE) -f ymakefile lint
52
53client: ymakefile
54	$(MAKE) $(MFLAGS) -f ymakefile client
55
56ymakefile: Makefile xmakefile config.h
57	cp xmakefile MF.c
58	$(CPP) -DCOMPILER="$(CC)" -DPREPROC="$(CPP)" \
59	       -DLDEBUG="$(LDFLAGS)" \
60	       -DCDEBUG="$(CFLAGS)" -Iconf MF.c | \
61	sed -e '1,/MAKE WILL CUT HERE/d' \
62	    -e '/^#/d' \
63	    -e 's/^  */	/' \
64	    -e '/^[ \f	]$$/d' \
65	    -e '/^[ \/]*[*]/d' | \
66	sed -n -e '/^..*$$/p' > ymakefile
67	rm -f MF.c
68
69#
70# clean up
71#	Will remove object and executeable files.
72#
73
74clean:	ymakefile
75	make -f ymakefile clean
76	rm -f *.o *~ ymakefile
77
78#
79# distribution
80#
81
82distrib: man/nn.1.D
83	[ -d DIST ] || mkdir DIST
84	rm DIST/Part.*
85	makekit -m -k30 -s55000 -nDIST/Part.
86
87tar: man/nn.1.D
88	chmod +x FILES
89	rm -f /tmp/nn64tar*
90	tar cf /tmp/nn64tar `FILES`
91	cd /tmp && compress nn64tar
92
93split: tar
94	rm -f /tmp/nn64z*
95	cd /tmp && bsplit -b40000 -pnn64z -v < nn64tar.Z
96
97man/nn.1.D: man/nn.1
98	sh SPLITNN1
99
100install:
101	./inst n
102
103