]>
Commit | Line | Data |
---|---|---|
14c7c974 A |
1 | |
2 | # Makefile for i386 boot program | |
3 | # define FLOPPY and SMALL using DEFINES macro as necessary | |
4 | ||
5 | DIR = boot2 | |
6 | include ../MakePaths.dir | |
7 | ||
bba600dd | 8 | OPTIM = -Os -Oz |
75b89a82 | 9 | CFLAGS = $(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 \ | |
bba600dd | 12 | -fno-align-functions -mno-sse2 -mfpmath=387 |
14c7c974 A |
13 | DEFINES= |
14 | CONFIG = hd | |
15 | SYMDIR = $(SYMROOT) | |
16 | LIBSADIR = ../libsa | |
17 | LIBSAIODIR = ../libsaio | |
18 | UTILDIR = ../util | |
19 | INC = -I. -I.. -I$(SYMDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I$(UTILDIR) | |
20 | ifneq "" "$(wildcard /bin/mkdirs)" | |
21 | MKDIRS = /bin/mkdirs | |
22 | else | |
23 | MKDIRS = /bin/mkdir -p | |
24 | endif | |
25 | AS = as | |
bba600dd | 26 | LD = gcc |
14c7c974 | 27 | # LIBS= -lc_static |
57c72a9a A |
28 | LIBS= -L$(SYMDIR) -lsaio -lsa |
29 | LIBDEP= $(SYMDIR)/libsaio.a $(SYMDIR)/libsa.a | |
14c7c974 A |
30 | |
31 | OTHER_FILES = | |
32 | ||
33 | INSTALLDIR = $(DSTROOT)/usr/standalone/i386 | |
34 | VPATH = $(OBJROOT):$(SYMROOT) | |
35 | ||
36 | # The ordering is important; | |
37 | # boot2.o must be first. | |
f083c6c3 | 38 | OBJS = 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 | ||
41 | UTILDIR = ../util | |
42 | SFILES = boot2.s | |
75b89a82 | 43 | CFILES = boot.c graphics.c drivers.c prompt.c options.c |
f083c6c3 | 44 | HFILES = boot.h appleClut8.h appleboot.h |
14c7c974 A |
45 | OTHERFILES = Makefile |
46 | ALLSRC = $(FOREIGNSRC) $(FOREIGNBIN) $(SFILES) $(CFILES) \ | |
47 | $(HFILES) $(OTHERFILES) | |
48 | DIRS_NEEDED = $(OBJROOT) $(SYMROOT) | |
75b89a82 A |
49 | BOOT2ADDR = 20200 |
50 | MAXBOOTSIZE = 65024 | |
14c7c974 A |
51 | |
52 | all: $(DIRS_NEEDED) boot | |
53 | ||
f083c6c3 | 54 | boot: machOconv $(OBJS) $(LIBDEP) |
bba600dd A |
55 | $(LD) -static -Wl,-preload -Wl,-segaddr,__TEXT,$(BOOT2ADDR) \ |
56 | -nostdlib -arch i386 -Wl,-segalign,20 \ | |
57c72a9a | 57 | -o $(SYMROOT)/boot.sys $(filter %.o,$^) $(LIBS) -lcc_kext |
14c7c974 A |
58 | machOconv $(SYMROOT)/boot.sys $(SYMROOT)/boot |
59 | size $(SYMROOT)/boot.sys | |
60 | ls -l $(SYMROOT)/boot | |
61 | @( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \ | |
62 | if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\ | |
63 | then \ | |
64 | echo "Booter executable larger than $(MAXBOOTSIZE) bytes" ;\ | |
65 | rm $(SYMROOT)/boot ;\ | |
66 | exit 1;\ | |
67 | fi) | |
68 | ||
69 | prompt.o: vers.h | |
70 | vers.h: | |
71 | echo "#define I386BOOT_VERSION \"`vers_string -f 5.0`\"" | \ | |
72 | tr - . > $(SYMROOT)/vers.h | |
73 | ||
74 | install_i386:: all $(INSTALLDIR) | |
75 | cp $(SYMROOT)/boot $(OTHER_FILES) $(INSTALLDIR) | |
76 | cd $(INSTALLDIR); chmod u+w boot $(OTHER_FILES) | |
77 | ||
78 | clean:: | |
57c72a9a | 79 | rm -f $(SYMROOT)/boot.sys $(SYMROOT)/boot $(SYMROOT)/vers.h |
14c7c974 A |
80 | |
81 | include ../MakeInc.dir | |
82 | ||
83 | #dependencies | |
84 | -include $(OBJROOT)/Makedep |