2 # Makefile for i386 boot program
3 # define FLOPPY and SMALL using DEFINES macro as necessary
6 include ../MakePaths.dir
9 CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Wno-precomp \
10 -munaligned-text -DSAIO_INTERNAL_USER -static -traditional-cpp
15 LIBSAIODIR = ../libsaio
17 INC = -I. -I.. -I$(SYMDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(UTILDIR)
18 ifneq "" "$(wildcard /bin/mkdirs)"
21 MKDIRS = /bin/mkdir -p
26 LIBS= -L$(SYMDIR) -lsaio -lsa -lrcz
30 INSTALLDIR = $(DSTROOT)/usr/standalone/i386
31 VPATH = $(OBJROOT):$(SYMROOT)
33 # The ordering is important;
34 # boot2.o must be first.
35 OBJS = boot2.o boot.o graphics.o prompt.o
36 # button.o browser.o scrollbar.o == NOTYET
40 CFILES = boot.c graphics.c prompt.c
43 ALLSRC = $(FOREIGNSRC) $(FOREIGNBIN) $(SFILES) $(CFILES) \
44 $(HFILES) $(OTHERFILES)
45 DIRS_NEEDED = $(OBJROOT) $(SYMROOT)
49 all: $(DIRS_NEEDED) boot
51 boot: machOconv $(OBJS)
52 $(LD) -static -preload -segaddr __TEXT $(BOOT2ADDR) -segalign 20 \
53 -o $(SYMROOT)/boot.sys $(OBJS) $(LIBS) -lcc_kext
54 machOconv $(SYMROOT)/boot.sys $(SYMROOT)/boot
55 size $(SYMROOT)/boot.sys
57 @( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \
58 if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\
60 echo "Booter executable larger than $(MAXBOOTSIZE) bytes" ;\
67 echo "#define I386BOOT_VERSION \"`vers_string -f 5.0`\"" | \
68 tr - . > $(SYMROOT)/vers.h
70 install_i386:: all $(INSTALLDIR)
71 cp $(SYMROOT)/boot $(OTHER_FILES) $(INSTALLDIR)
72 cd $(INSTALLDIR); chmod u+w boot $(OTHER_FILES)
75 rm -f $(SYMROOT)/boot.sys $(SYMROOT)/boot
77 include ../MakeInc.dir
80 -include $(OBJROOT)/Makedep