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