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 -Werror \
10 -fno-builtin -DSAIO_INTERNAL_USER -static \
11 -fomit-frame-pointer -mpreferred-stack-boundary=2 \
17 LIBSAIODIR = ../libsaio
19 INC = -I. -I.. -I$(SYMDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(UTILDIR)
20 ifneq "" "$(wildcard /bin/mkdirs)"
23 MKDIRS = /bin/mkdir -p
28 LIBS= -L$(SYMDIR) -lsaio -lsa -lrcz
29 LIBDEP= $(SYMDIR)/libsaio.a $(SYMDIR)/libsa.a $(SYMDIR)/librcz.a
33 INSTALLDIR = $(DSTROOT)/usr/standalone/i386
34 VPATH = $(OBJROOT):$(SYMROOT)
36 # The ordering is important;
37 # boot2.o must be first.
38 OBJS = boot2.o boot.o graphics.o drivers.o prompt.o options.o lzss.o
39 # button.o browser.o scrollbar.o == NOTYET
43 CFILES = boot.c graphics.c drivers.c prompt.c options.c
44 HFILES = boot.h appleClut8.h appleboot.h
46 ALLSRC = $(FOREIGNSRC) $(FOREIGNBIN) $(SFILES) $(CFILES) \
47 $(HFILES) $(OTHERFILES)
48 DIRS_NEEDED = $(OBJROOT) $(SYMROOT)
52 all: $(DIRS_NEEDED) boot
54 boot: machOconv $(OBJS) $(LIBDEP)
55 $(LD) -static -preload -segaddr __TEXT $(BOOT2ADDR) -segalign 20 \
56 -o $(SYMROOT)/boot.sys $(OBJS) $(LIBS) -lcc_kext
57 machOconv $(SYMROOT)/boot.sys $(SYMROOT)/boot
58 size $(SYMROOT)/boot.sys
60 @( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \
61 if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\
63 echo "Booter executable larger than $(MAXBOOTSIZE) bytes" ;\
70 echo "#define I386BOOT_VERSION \"`vers_string -f 5.0`\"" | \
71 tr - . > $(SYMROOT)/vers.h
73 install_i386:: all $(INSTALLDIR)
74 cp $(SYMROOT)/boot $(OTHER_FILES) $(INSTALLDIR)
75 cd $(INSTALLDIR); chmod u+w boot $(OTHER_FILES)
78 rm -f $(SYMROOT)/boot.sys $(SYMROOT)/boot
80 include ../MakeInc.dir
83 -include $(OBJROOT)/Makedep