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