]> git.saurik.com Git - apple/boot.git/blame - i386/boot2/Makefile
boot-111.1.tar.gz
[apple/boot.git] / i386 / boot2 / Makefile
CommitLineData
14c7c974
A
1
2# Makefile for i386 boot program
3# define FLOPPY and SMALL using DEFINES macro as necessary
4
5DIR = boot2
6include ../MakePaths.dir
7
8OPTIM = -Os
75b89a82 9CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \
f083c6c3
A
10 -fno-builtin -DSAIO_INTERNAL_USER -static \
11 -fomit-frame-pointer -mpreferred-stack-boundary=2 \
12 -fno-align-functions
14c7c974
A
13DEFINES=
14CONFIG = hd
15SYMDIR = $(SYMROOT)
16LIBSADIR = ../libsa
17LIBSAIODIR = ../libsaio
18UTILDIR = ../util
19INC = -I. -I.. -I$(SYMDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(UTILDIR)
20ifneq "" "$(wildcard /bin/mkdirs)"
21 MKDIRS = /bin/mkdirs
22else
23 MKDIRS = /bin/mkdir -p
24endif
25AS = as
26LD = ld
27# LIBS= -lc_static
28LIBS= -L$(SYMDIR) -lsaio -lsa -lrcz
f083c6c3 29LIBDEP= $(SYMDIR)/libsaio.a $(SYMDIR)/libsa.a $(SYMDIR)/librcz.a
14c7c974
A
30
31OTHER_FILES =
32
33INSTALLDIR = $(DSTROOT)/usr/standalone/i386
34VPATH = $(OBJROOT):$(SYMROOT)
35
36# The ordering is important;
37# boot2.o must be first.
f083c6c3 38OBJS = boot2.o boot.o graphics.o drivers.o prompt.o options.o lzss.o
14c7c974
A
39# button.o browser.o scrollbar.o == NOTYET
40
41UTILDIR = ../util
42SFILES = boot2.s
75b89a82 43CFILES = boot.c graphics.c drivers.c prompt.c options.c
f083c6c3 44HFILES = boot.h appleClut8.h appleboot.h
14c7c974
A
45OTHERFILES = Makefile
46ALLSRC = $(FOREIGNSRC) $(FOREIGNBIN) $(SFILES) $(CFILES) \
47 $(HFILES) $(OTHERFILES)
48DIRS_NEEDED = $(OBJROOT) $(SYMROOT)
75b89a82
A
49BOOT2ADDR = 20200
50MAXBOOTSIZE = 65024
14c7c974
A
51
52all: $(DIRS_NEEDED) boot
53
f083c6c3 54boot: machOconv $(OBJS) $(LIBDEP)
14c7c974
A
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
59 ls -l $(SYMROOT)/boot
60 @( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \
61 if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\
62 then \
63 echo "Booter executable larger than $(MAXBOOTSIZE) bytes" ;\
64 rm $(SYMROOT)/boot ;\
65 exit 1;\
66 fi)
67
68prompt.o: vers.h
69vers.h:
70 echo "#define I386BOOT_VERSION \"`vers_string -f 5.0`\"" | \
71 tr - . > $(SYMROOT)/vers.h
72
73install_i386:: all $(INSTALLDIR)
74 cp $(SYMROOT)/boot $(OTHER_FILES) $(INSTALLDIR)
75 cd $(INSTALLDIR); chmod u+w boot $(OTHER_FILES)
76
77clean::
78 rm -f $(SYMROOT)/boot.sys $(SYMROOT)/boot
79
80include ../MakeInc.dir
81
82#dependencies
83-include $(OBJROOT)/Makedep