move address of boot program. Kernels were getting too large. (from ralph)
[unix-history] / usr / src / sys / pmax / stand / Makefile
index 1a3c555..632b31b 100644 (file)
@@ -1,50 +1,77 @@
-#      @(#)Makefile    5.1 (Berkeley) %G%
+#      @(#)Makefile    8.4 (Berkeley) %G%
 
 DESTDIR=
 
 DESTDIR=
-STAND= /stand
-INCPATH= -I../.. -I../../sys
-DEFS=  ${INCPATH} -DSTANDALONE -D_MONFUNCS -DSMALL
+STAND= ../../stand
+INCPATH=-I. -I/sys
+VPATH= ${STAND}
 
 
-# Collections of C options:
-#      COPTS   device drivers/assembler, not optimized
-#      CFLAGS  everything else
+# RELOC=80300000 allows for boot prog up to 2D0000 (2949120) bytes long
+RELOC= 80300000
 
 
-COPTS= ${DEFS}
-CFLAGS=        -O ${DEFS}
+DEFS= -DSTANDALONE -DSMALL
+CFLAGS=        -O2 ${INCPATH} ${DEFS}
+AFLAGS=        -O2 ${INCPATH} ${DEFS} -DLOCORE
 
 
-SRCS=  mkboot.c
+DRIVERS= rz.c
+SRCS=  ${DRIVERS}
+LIBS=  libdrive.a libsa/libsa.a ../../libkern/obj/libkern.a
 
 
-ALL=   mkboot boot mkboottape
+ALL=   boot mkboot mkboottape dec_label
+
+.s.o:
+       ${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
+           ${AS} -o ${.TARGET}
 
 all: ${ALL}
 
 
 all: ${ALL}
 
-mkboot: mkboot.c
-       ${CC} ${CFLAGS} -o $@ mkboot.c
+libsa/libsa.a::
+       cd libsa; make
 
 
-boot: start.o boot.o conf.o sys.o
-       ld -N -T 80100000 -o $@ start.o boot.o conf.o sys.o
+libdrive.a: conf.o ${DRIVERS:.c=.o}
+       ar crv $@ $?
+       ranlib $@
 
 
-mkboottape: mkboottape.c
-       ${CC} ${CFLAGS} -o $@ mkboottape.c
+# depend on DEFS
 
 
-# for testing
-tboot: boot.c
-       cc -o $@ ${CFLAGS} -DTEST boot.c
+# bootable from real disks
 
 
-clean:
-       rm -f *.o ${ALL} a.out core errs
+boot:  start.o boot.o bootconf.o ${LIBS}
+       ld -N -Ttext ${RELOC} -e start start.o boot.o bootconf.o ${LIBS} -o $@ 
 
 
-depend: ${SRCS}
-       mkdep ${INCPATH} -DSTANDALONE ${SRCS}
+start.o: start.s
+       ${CPP} -E ${CFLAGS:M-[ID]*} -DLOCORE ${AINC} ${.IMPSRC} | \
+           ${AS} -o ${.TARGET}
+
+bootconf.o: conf.o
+       rm -f bootconf.c
+       ln -s conf.c bootconf.c
+       ${CC} -c ${CFLAGS} -DBOOT bootconf.c
+       rm -f bootconf.c
 
 
-install: FRC
-       mkboot boot ${DESTDIR}/usr/mdec/rzboot ${DESTDIR}/usr/mdec/bootrz
+mkboot: mkboot.c
+       ${CC} ${CFLAGS} -o mkboot mkboot.c
+
+mkboottape: mkboottape.c
+       ${CC} ${CFLAGS} -o mkboottape mkboottape.c
 
 
-lint: ${SRCS}
-       lint ${COPTS} -hxbn boot.c ${SRCS}
+dec_label: dec_label.c
+       ${CC} ${CFLAGS} -o dec_label dec_label.c
 
 
-tags: ${SRCS}
-       ctags ${SRCS}
+# utilities
 
 
-FRC:
+clean cleandir:
+       rm -f .depend *.o *.exe *.i errs make.out core*
+       rm -f a.out ${ALL}
+       rm -f boot[a-z][a-z] [a-z][a-z]boot
+       rm -f libdrive.a
+       cd libsa; make cleandir
 
 
+install:
+       ./mkboot boot rzboot bootrz
+       install -o bin -g bin -m 444 rzboot ${DESTDIR}/usr/mdec
+       install -o bin -g bin -m 444 bootrz ${DESTDIR}/usr/mdec
+
+depend: ${SRCS}
+       mkdep ${INCPATH} ${DEFS} ${SRCS}
+       mkdep -a -p ${INCPATH} ${DEFS} mkboot.c mkboottape.c
+       cd libsa; make depend