xref: /csrg-svn/old/sdb/Makefile (revision 8916)
11356Sbill#
2*8916Srrh#	sdb	Makefile	4.4	10/27/82
31356Sbill#
41356Sbill# Conditional compilation flags:
55793Sroot#	SDB	this is sdb
61356Sbill#	STD - Distribution systems UNIX/32V, VM/UNIX 2.n
71356Sbill#	VMUNIX - virtual memory system - keep namelist in VM.
81356Sbill#	VFORK - Use vfork call of VM/UNIX Berkeley version
91356Sbill#	FLEXNAMES - New a.out format with string table (VMUNIX Version 4)
101356Sbill#
111356Sbill# The files old.c and old.h contain routines and definitions peculiar
121356Sbill# to old versions of the system.
131356Sbill#
145793SrootCFLAGS=	-R -DSDB -DVMUNIX -DVFORK -DFLEXNAMES
151356Sbill
16*8916SrrhADB = /usr/src/bin/adb
17*8916SrrhAS = /usr/src/bin/as
18*8916SrrhSHARE = $(ADB)
19*8916Srrh
201356SbillSRCS=	access.c decode.c display.c docomm.c fio.c main.c message.c \
21*8916Srrh	old.c $(SHARE)/opset.c $(SHARE)/optab.c pcs.c prvar.c re.c runpcs.c \
22*8916Srrh	setup.c sub.c symt.c udef.c version.c xeq.c reginit.c
231356SbillOBJS=	access.o decode.o display.o docomm.o fio.o main.o message.o \
241356Sbill	old.o opset.o optab.o pcs.o prvar.o re.o runpcs.o \
25*8916Srrh	setup.o sub.o symt.o udef.o version.o xeq.o reginit.o
261356SbillHDRS=	cdefs.h defs.h head.h mac.h machine.h mode.h old.h
271356Sbill
281356Sbillsdb: sources ${OBJS}
291356Sbill	cc -o sdb *.o
301356Sbill
31*8916Srrh#
32*8916Srrh#	An apparent bug in /lib/cpp prevents us from compiling
33*8916Srrh#	directly from $(SHARE)/{opset,optab}.c; the wrong
34*8916Srrh#	version of head.h is included (cpp gets $(SHARE)/head.h;
35*8916Srrh#	we want head.h).  Consequently, the copy
36*8916Srrh#
37*8916Srrhopset.c: $(SHARE)/opset.c
38*8916Srrh	cp $(SHARE)/opset.c opset.c
39*8916Srrhoptab.c: $(SHARE)/optab.c
40*8916Srrh	cp $(SHARE)/optab.c optab.c
41*8916Srrhinstrs.adb: $(SHARE)/instrs.adb
42*8916Srrh	cp $(SHARE)/instrs.adb instrs.adb
43*8916Srrh#
44*8916Srrh#	Now, compile them
45*8916Srrh#
46*8916Srrhopset.o: opset.c
47*8916Srrh	$(CC) -I. -I$(AS) $(CFLAGS) -c opset.c
48*8916Srrhoptab.o: optab.c instrs.adb
49*8916Srrh	$(CC) -I. -I$(AS) $(CFLAGS) -c optab.c
50*8916Srrh$(SHARE)/instrs.adb: $(AS)/instrs
51*8916Srrh	cd $(SHARE); make instrs.adb
521356Sbillinstall:
531356Sbill	cp sdb sdb.temp
541356Sbill	install -s sdb $(DESTDIR)/usr/bin
551356Sbill	mv sdb.temp sdb
561356Sbillclean:
571356Sbill	rm -f *.o sdb
581356Sbill
591356Sbillprint:
601356Sbill	ls -l Makefile | pr
611356Sbill	pr -f *.h *.c
621356Sbill
631356Sbillsources: ${SRCS} ${HDRS}
641356Sbill${SRCS} ${HDRS}:
651356Sbill	sccs get $@
661356Sbill
671356Sbilldepend:
681356Sbill	/bin/grep '^#[ 	]*include' ${SRCS} \
691356Sbill		| sed '/<.*>/d' \
701356Sbill		| sed 's/:[^"]*"\([^"]*\)".*/: \1/' \
711356Sbill		| sed 's/\.c/.o/' >>makedep
721356Sbill	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
731356Sbill	echo '$$r makedep' >>eddep
741356Sbill	echo 'w' >>eddep
751356Sbill	cp Makefile Makefile.bak
761356Sbill	ed - Makefile < eddep
771356Sbill	rm eddep makedep
781356Sbill	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
791356Sbill	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
801356Sbill	echo '# see make depend above' >> Makefile
811356Sbill
821356Sbill# DO NOT DELETE THIS LINE -- make depend uses it
83