Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.9
      1  1.1       is MAN=installboot.8
      2  1.1       is 
      3  1.2       is ### what we need:
      4  1.1       is 
      5  1.2       is S=		${.CURDIR}/../../../..
      6  1.2       is DIR_SA = 	${S}/lib/libsa
      7  1.2       is DIR_KERN=	${S}/lib/libkern
      8  1.2       is DIR_KERN_MD=	${S}/lib/libkern/arch/$(MACHINE_ARCH)
      9  1.1       is 
     10  1.2       is .PATH:  $(DIR_SA) $(DIR_KERN) $(DIR_KERN_MD)
     11  1.1       is 
     12  1.2       is # prefer our assembler versions over assembler, and assembler over C:
     13  1.1       is 
     14  1.2       is .SUFFIXES:
     15  1.2       is .SUFFIXES: .out .o .po .so .s .S .c .cc .C .f .y .l .ln .m4 .sh
     16  1.1       is 
     17  1.2       is SRCS=installboot.sh
     18  1.1       is 
     19  1.5  mycroft BOOTBLOCKS= xxboot fdboot
     20  1.1       is 
     21  1.2       is COBJS = configure.o main.o console.o xd.o twiddle.o bzero.o gets.o
     22  1.2       is COBJS+=  lseek.o open.o read.o close.o dev.o
     23  1.2       is COBJS+=  ufs.o
     24  1.1       is 
     25  1.2       is SOBJS = alloc.o ashrdi3.o bcopy.o muldi3.o printf.o startit.o
     26  1.2       is SOBJS += strlen.o strcmp.o
     27  1.2       is SOBJS += libstubs.o 
     28  1.1       is 
     29  1.2       is OBJS=	$(SOBJS) $(COBJS)
     30  1.1       is 
     31  1.2       is DEFS = -DSTANDALONE -DINSECURE
     32  1.1       is 
     33  1.2       is ### main target: ###
     34  1.1       is 
     35  1.2       is all: ${BOOTBLOCKS} installboot
     36  1.1       is 
     37  1.2       is ### special  rules for bootblocks ###
     38  1.1       is 
     39  1.2       is AFLAGS += -m68030 -l
     40  1.2       is CAFLAGS += -Wa,-l -Wa,-m68030
     41  1.1       is 
     42  1.2       is INCPATH = -I${S} -I${S}/lib/libsa -I${.CURDIR} -I${.CURDIR}/../..
     43  1.2       is BB_COPTIM= -O2 -fomit-frame-pointer -fno-function-cse -Wa,-l -m68060 -Wa,-m68030
     44  1.2       is BB_CFLAGS = ${BB_COPTIM} ${INCPATH} ${DEFS} -Wall #-Wstrict-prototypes
     45  1.1       is 
     46  1.2       is .c.o:
     47  1.2       is 	$(CC) $(BB_CFLAGS) -S $< -o $*.s
     48  1.2       is 	./txlt < $*.s | $(AS) $(AFLAGS) -o $*.o
     49  1.2       is 	rm $*.s
     50  1.1       is 
     51  1.2       is .s.o: ; $(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp -o $@ -c $<
     52  1.1       is 
     53  1.2       is .S.o: ; $(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp -o $@ -c $<
     54  1.1       is 
     55  1.2       is ${COBJS}: txlt
     56  1.1       is 
     57  1.2       is ${BOOTBLOCKS}: aout2bb
     58  1.2       is 
     59  1.3       is CLEANFILES += xxboot fdboot x.out f.out xxstart.o fdstart.o libboot.a
     60  1.1       is 
     61  1.1       is xxboot: x.out
     62  1.2       is 	./aout2bb x.out $@ || nm -u x.out
     63  1.1       is 
     64  1.1       is fdboot: f.out
     65  1.2       is 	./aout2bb f.out $@ || nm -u f.out
     66  1.2       is 
     67  1.2       is x.out: xxstart.o libboot.a
     68  1.2       is 	$(LD) $(LDFLAGS) -r -dc -e _start -o $@ $>
     69  1.2       is 	size $@
     70  1.2       is 	nm -u $@
     71  1.2       is 
     72  1.2       is f.out: fdstart.o libboot.a
     73  1.2       is 	$(LD) $(LDFLAGS) -r -dc -e _start -o $@ $>
     74  1.2       is 	size $@
     75  1.2       is 	nm -u $@
     76  1.2       is 
     77  1.2       is xxstart.o: ${.CURDIR}/bbstart.s
     78  1.2       is 	$(CC) $(CAFLAGS) $(COPTS) -x assembler-with-cpp \
     79  1.2       is 		-o $@ -c $>
     80  1.2       is 
     81  1.2       is fdstart.o: ${.CURDIR}/bbstart.s
     82  1.2       is 	$(CC) -DAUTOLOAD=8192 $(CAFLAGS) $(COPTS) -x assembler-with-cpp \
     83  1.2       is 		-o $@ -c $>
     84  1.1       is 
     85  1.2       is libboot.a: $(OBJS)
     86  1.2       is 	ar r $@ $> && ranlib $@
     87  1.2       is 
     88  1.2       is ### install what we need: ###
     89  1.1       is 
     90  1.8  mycroft install:
     91  1.2       is 	install -o $(BINOWN) -g $(BINGRP) installboot ${DESTDIR}/usr/sbin
     92  1.2       is 	install -o $(BINOWN) -g $(BINGRP) $(BOOTBLOCKS) ${DESTDIR}/usr/mdec
     93  1.2       is 
     94  1.2       is ### start of helper programs: ###
     95  1.2       is 
     96  1.2       is HOSTED_CC=	$(CC)
     97  1.2       is HOSTED_CFLAGS=	$(CFLAGS)
     98  1.2       is 
     99  1.2       is HOSTED_C=	${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
    100  1.2       is 
    101  1.2       is CLEANFILES += txlt txlt.o aout2bb aout2bb.o chksum.o
    102  1.2       is 
    103  1.2       is aout2bb: aout2bb.o chksum.o
    104  1.2       is 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $>
    105  1.1       is 
    106  1.2       is aout2bb.o: ${.CURDIR}/aout2bb.c
    107  1.2       is 	${HOSTED_C}
    108  1.1       is 
    109  1.2       is chksum.o: ${.CURDIR}/chksum.c
    110  1.2       is 	${HOSTED_C}
    111  1.1       is 
    112  1.2       is txlt: txlt.o
    113  1.2       is 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $> -ll
    114  1.1       is 
    115  1.9    veego depend:
    116  1.2       is 	mkdep -a ${.CURDIR}/aout2bb.c ${.CURDIR}/chksum.c
    117  1.1       is 
    118  1.2       is ### end of helper programs ###
    119  1.1       is 
    120  1.1       is .include <bsd.prog.mk>
    121