xref: /original-bsd/old/sdb/Makefile (revision 3b6618e7)
1f64e11aeSbill#
2*3b6618e7Srrh#	sdb	Makefile	4.4	10/27/82
3f64e11aeSbill#
4f64e11aeSbill# Conditional compilation flags:
52bac6ef8Sroot#	SDB	this is sdb
6f64e11aeSbill#	STD - Distribution systems UNIX/32V, VM/UNIX 2.n
7f64e11aeSbill#	VMUNIX - virtual memory system - keep namelist in VM.
8f64e11aeSbill#	VFORK - Use vfork call of VM/UNIX Berkeley version
9f64e11aeSbill#	FLEXNAMES - New a.out format with string table (VMUNIX Version 4)
10f64e11aeSbill#
11f64e11aeSbill# The files old.c and old.h contain routines and definitions peculiar
12f64e11aeSbill# to old versions of the system.
13f64e11aeSbill#
142bac6ef8SrootCFLAGS=	-R -DSDB -DVMUNIX -DVFORK -DFLEXNAMES
15f64e11aeSbill
16*3b6618e7SrrhADB = /usr/src/bin/adb
17*3b6618e7SrrhAS = /usr/src/bin/as
18*3b6618e7SrrhSHARE = $(ADB)
19*3b6618e7Srrh
20f64e11aeSbillSRCS=	access.c decode.c display.c docomm.c fio.c main.c message.c \
21*3b6618e7Srrh	old.c $(SHARE)/opset.c $(SHARE)/optab.c pcs.c prvar.c re.c runpcs.c \
22*3b6618e7Srrh	setup.c sub.c symt.c udef.c version.c xeq.c reginit.c
23f64e11aeSbillOBJS=	access.o decode.o display.o docomm.o fio.o main.o message.o \
24f64e11aeSbill	old.o opset.o optab.o pcs.o prvar.o re.o runpcs.o \
25*3b6618e7Srrh	setup.o sub.o symt.o udef.o version.o xeq.o reginit.o
26f64e11aeSbillHDRS=	cdefs.h defs.h head.h mac.h machine.h mode.h old.h
27f64e11aeSbill
28f64e11aeSbillsdb: sources ${OBJS}
29f64e11aeSbill	cc -o sdb *.o
30f64e11aeSbill
31*3b6618e7Srrh#
32*3b6618e7Srrh#	An apparent bug in /lib/cpp prevents us from compiling
33*3b6618e7Srrh#	directly from $(SHARE)/{opset,optab}.c; the wrong
34*3b6618e7Srrh#	version of head.h is included (cpp gets $(SHARE)/head.h;
35*3b6618e7Srrh#	we want head.h).  Consequently, the copy
36*3b6618e7Srrh#
37*3b6618e7Srrhopset.c: $(SHARE)/opset.c
38*3b6618e7Srrh	cp $(SHARE)/opset.c opset.c
39*3b6618e7Srrhoptab.c: $(SHARE)/optab.c
40*3b6618e7Srrh	cp $(SHARE)/optab.c optab.c
41*3b6618e7Srrhinstrs.adb: $(SHARE)/instrs.adb
42*3b6618e7Srrh	cp $(SHARE)/instrs.adb instrs.adb
43*3b6618e7Srrh#
44*3b6618e7Srrh#	Now, compile them
45*3b6618e7Srrh#
46*3b6618e7Srrhopset.o: opset.c
47*3b6618e7Srrh	$(CC) -I. -I$(AS) $(CFLAGS) -c opset.c
48*3b6618e7Srrhoptab.o: optab.c instrs.adb
49*3b6618e7Srrh	$(CC) -I. -I$(AS) $(CFLAGS) -c optab.c
50*3b6618e7Srrh$(SHARE)/instrs.adb: $(AS)/instrs
51*3b6618e7Srrh	cd $(SHARE); make instrs.adb
52f64e11aeSbillinstall:
53f64e11aeSbill	cp sdb sdb.temp
54f64e11aeSbill	install -s sdb $(DESTDIR)/usr/bin
55f64e11aeSbill	mv sdb.temp sdb
56f64e11aeSbillclean:
57f64e11aeSbill	rm -f *.o sdb
58f64e11aeSbill
59f64e11aeSbillprint:
60f64e11aeSbill	ls -l Makefile | pr
61f64e11aeSbill	pr -f *.h *.c
62f64e11aeSbill
63f64e11aeSbillsources: ${SRCS} ${HDRS}
64f64e11aeSbill${SRCS} ${HDRS}:
65f64e11aeSbill	sccs get $@
66f64e11aeSbill
67f64e11aeSbilldepend:
68f64e11aeSbill	/bin/grep '^#[ 	]*include' ${SRCS} \
69f64e11aeSbill		| sed '/<.*>/d' \
70f64e11aeSbill		| sed 's/:[^"]*"\([^"]*\)".*/: \1/' \
71f64e11aeSbill		| sed 's/\.c/.o/' >>makedep
72f64e11aeSbill	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
73f64e11aeSbill	echo '$$r makedep' >>eddep
74f64e11aeSbill	echo 'w' >>eddep
75f64e11aeSbill	cp Makefile Makefile.bak
76f64e11aeSbill	ed - Makefile < eddep
77f64e11aeSbill	rm eddep makedep
78f64e11aeSbill	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
79f64e11aeSbill	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
80f64e11aeSbill	echo '# see make depend above' >> Makefile
81f64e11aeSbill
82f64e11aeSbill# DO NOT DELETE THIS LINE -- make depend uses it
83