added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / i386-pc / boot / mmakefile.src
blob97aa505a9040c9fad6cb2f2e826ccc0bf0703620
1 # $Id$
2 include $(TOP)/config/make.cfg
4 FILES   := libexec
5 USELIBS := hiddgraphicsstubs hiddstubs amiga arossupport rom arosm autoinit libinit
6 LIBS    := $(addprefix -l,$(USELIBS))
7 DEPLIBS := $(addprefix $(LIBDIR)/lib,$(addsuffix .a,$(USELIBS)))
9 KRSRCS  := bootloader battclock bootmenu misc
10 KLIBS   := exec boot aros dos graphics utility intuition keymap \
11            mathieeesingbas expansion oop layers workbench cybergraphics \
12            partition
13 KDEVS   := timer input keyboard console gameport ata trackdisk
14 KHNDLRS := con nil packet ram cdrom afs sfs
15 KHIDDS  := hiddclass serial mouse irq graphics kbd vesagfx vgah pci pcipc
16 #Disabled RSRC cpu
17 #Disabled HIDD vmwaregfx usbuhci
19 .PHONY: $(PORTSDIR)/aros$(AROS_TARGET_SUFFIX)-$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU).iso
21 KOBJS := $(addprefix $(KOBJSDIR)/,$(addsuffix _resource.o,$(KRSRCS) )) \
22          $(addprefix $(KOBJSDIR)/,$(addsuffix _library.o ,$(KLIBS)  )) \
23          $(addprefix $(KOBJSDIR)/,$(addsuffix _device.o  ,$(KDEVS)  )) \
24          $(addprefix $(KOBJSDIR)/,$(addsuffix _handler.o ,$(KHNDLRS))) \
25          $(addprefix $(KOBJSDIR)/,$(addsuffix _hidd.o    ,$(KHIDDS) )) \
26          $(addprefix $(KOBJSDIR)/,$(addsuffix _driver.o  ,$(KDRVRS) ))
28 BOOT_FILES := \
29     C/Shell \
30     S/Startup-Sequence \
31     C/Unpack \
32     boot/grub/stage1 \
33     boot/grub/menu.lst
35 BOOT_TAR_FILES := \
36     C/AddBuffers C/AddDatatypes C/Alias C/Ask C/Assign C/Avail C/Break C/CD \
37     C/ChangeTaskPri C/ConClip C/Copy C/Date C/Delete C/Dir C/Echo C/Else \
38     C/EndCli C/EndIf C/EndSkip C/Execute C/FailAt C/Fault C/Filenote C/Format \
39     C/Get C/Getenv C/IPrefs C/If C/Info C/Join C/Lab C/List C/Lock \
40     C/MakeDir C/MakeLink C/Mount C/NewShell C/Path C/Prompt C/Protect C/Quit \
41     C/Reboot C/Relabel C/Rename C/Resident C/Run C/Search C/Set C/SetClock \
42     C/SetDate C/Setenv C/Skip C/Stack C/Status C/Touch C/Type C/Unalias \
43     C/Unset C/Unsetenv C/Version C/Which C/Why C/install-i386-pc \
44     C/Partition \
45     Classes/Datatypes/ascii.datatype \
46     Classes/Datatypes/binary.datatype \
47     Classes/Datatypes/text.datatype \
48     Classes/Datatypes/picture.datatype \
49     Classes/Datatypes/ilbm.datatype \
50     Classes/Gadgets/colorwheel.gadget Classes/Gadgets/gradientslider.gadget \
51     Classes/Zune/AboutWindow.mcc Classes/Zune/Calendar.mcc \
52     Classes/Zune/IconImage.mcc Classes/Zune/PrefsWindow.mcc \
53     Classes/Zune/PrefsEditor.mcc Classes/Zune/SystemPrefsWindow.mcc \
54     Classes/Zune/Clock.mcc \
55     Devs.info \
56     Devs/DataTypes/ELF Devs/DataTypes/ELF_EXE Devs/DataTypes/ILBM \
57     Devs/DataTypes/FTXT \
58     Devs/Keymaps Devs/clipboard.device Devs/serial.device Devs/Mountlist \
59     Devs/pipefs.handler \
60     Fonts/fixed/8 Fonts/arial/13 Fonts/ttcourier/14 Fonts.info \
61     Libs/arosc.library Libs/asl.library Libs/commodities.library \
62     Libs/datatypes.library Libs/diskfont.library Libs/gadtools.library \
63     Libs/icon.library Libs/iffparse.library Libs/locale.library \
64     Libs/reqtools.library Libs/muimaster.library Libs/coolimages.library \
65     Locale.info \
66     Locale/Countries Locale/Help \
67     Prefs/Font Prefs/Font.info \
68     Prefs/Input.info Prefs/Time Prefs/Time.info \
69     Prefs.info Prefs/Env-Archive/SYS/font.prefs \
70     S/Shell-Startup S/Startup-Sequence \
71     System/About System/FixFonts System/FixFonts.info System/Themes/Mason \
72     System/Themes/os3.1 System/Wanderer System.info \
73     Tools/Editor Tools/HDToolBox Tools/HDToolBox.info Tools.info \
74     Tools/Debug
77 BOOT_SRC_DIR    := $(AROSDIR)
78 BOOT_DEST_DIR   := $(OSGENDIR)/bootdisk
79 BOOT_DEST_FILES := $(foreach f, $(BOOT_FILES), $(BOOT_DEST_DIR)/$(f))
81 #MM
82 setup-pc-i386 :
83         %mkdirs_q $(OSGENDIR)/boot
84         %mkdirs_q $(BINDIR)/boot
85         %mkdirs_q $(BINDIR)/boot/grub
86         -$(RM) -r $(BOOT_DEST_DIR)/*
87         %mkdirs_q $(BOOT_DEST_DIR)
88         %mkdirs_q $(BOOT_DEST_DIR)/C
89         %mkdirs_q $(BOOT_DEST_DIR)/S
90         %mkdirs_q $(BOOT_DEST_DIR)/Prefs
91         %mkdirs_q $(BOOT_DEST_DIR)/Prefs/Env-Archive
92         %mkdirs_q $(BOOT_DEST_DIR)/Prefs/Env-Archive/SYS
93         %mkdirs_q $(BOOT_DEST_DIR)/boot/grub
95 #MM kernel-link-pc-i386 : setup-pc-i386
96 kernel-link-pc-i386 : $(BINDIR)/boot/aros-pc-i386
98 $(BINDIR)/boot/aros-pc-i386 : $(OBJS) $(DEPLIBS)
99         @$(KERNEL_LD) -N -e kernel_startup -Ttext 0x00100000 \
100             -Map $(OSGENDIR)/boot/aros.map -o $@ $(KOBJS) -L$(LIBDIR) $(LIBS)
101         @$(TARGET_STRIP) --strip-unneeded -R .note -R .comment $@
103 $(BINDIR)/boot/aros-pc-i386.gz : $(BINDIR)/boot/aros-pc-i386
104         @gzip -9 -f $^
106 $(BINDIR)/boot/grub/menu.lst : menu.lst
107         @$(CP) $^ $@
109 $(BINDIR)/boot/grub/menu.lst.DH0 : menu.lst.DH0
110         @$(CP) $^ $@
112 $(BOOT_DEST_DIR)/boot/aros-pc-i386.gz : $(BINDIR)/boot/aros-pc-i386.gz
113         @$(CP) $^ $@
115 $(BOOT_DEST_DIR)/boot/grub/stage2 : $(AROSDIR)/boot/grub/stage2_hdisk
116         @$(CP) $^ $@
118 #MM workbench-boot-pc-i386
119 workbench-boot-pc-i386:
120         @$(NOP)
122 $(BINDIR)/boot/grub/% : %
123         @$(CP) $< $@
125 #MM- bootdisk : bootdisk-$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)
126 #MM bootdisk-pc-i386 : software-pc-i386 workbench test
127 bootdisk-pc-i386: $(OSGENDIR)/boot/aros.bin
130 bootdisk-pc-i386-quick : bootdisk-pc-i386
132 $(OSGENDIR)/boot/aros.bin: $(BOOT_DEST_FILES) $(BOOT_DEST_DIR)/boot/grub/stage2 $(BOOT_DEST_DIR)/AROS.pkg $(BOOT_DEST_DIR)/S/Startup-Sequence
133 $(OSGENDIR)/boot/aros.bin: $(BOOT_DEST_DIR)/boot/aros-pc-i386.gz install
134 $(OSGENDIR)/boot/aros.bin: $(BINDIR)/boot/grub/menu.lst $(BINDIR)/boot/grub/menu.lst.DH0
135         $(COPYTOAFS) $@ --name "AROS Live Floppy" --size floppy1440 $(BOOT_DEST_DIR)
136         ./install $@
138 $(BOOT_DEST_DIR)/S/Startup-Sequence:
139         @$(CP) $(TOP)/workbench/s/Startup-Sequence.DEMOFLOPPY $@
141 install: install.c
142         @$(HOST_CC) install.c -o install
144 $(BOOT_DEST_DIR)/AROS.pkg : $(addprefix $(BOOT_SRC_DIR)/,$(BOOT_TAR_FILES))
145         @$(CP) $(TOP)/workbench/s/Startup-Sequence $(AROSDIR)/S/Startup-Sequence
146         @$(RM) -rf $(GENDIR)/gen/rom/bootdisk.compressed
147         @$(MKDIR) -p $(GENDIR)/gen/rom/bootdisk.compressed
148         @( \
149             oldpwd=$$PWD; \
150             cd $(BOOT_SRC_DIR) && \
151             for path in $(BOOT_TAR_FILES); do \
152                 $(SH) $(TOP)/arch/i386-pc/boot/copypath $$path $(GENDIR)/gen/rom/bootdisk.compressed ; \
153             done && \
154             cd $(GENDIR)/gen/rom && \
155             $(RM) AROS.pkg && \
156             $(TOP)/tools/package/pkg c AROS.pkg bootdisk.compressed && \
157             bzip2 -9 AROS.pkg && \
158             mv -f AROS.pkg.bz2 $(BOOT_DEST_DIR)/AROS.pkg \
159         )
161 $(BOOT_DEST_DIR)/% : $(BOOT_SRC_DIR)/%
162         @$(CP) $< $@
164 #MM- bootiso : bootiso-$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)
165 #MM bootiso-pc-i386 : AROS-pc-i386
166 bootiso-pc-i386: $(PORTSDIR)/aros$(AROS_TARGET_SUFFIX)-$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU).iso
168 #MM bootiso-pc-i386-quick :
169 bootiso-pc-i386-quick: $(PORTSDIR)/aros$(AROS_TARGET_SUFFIX)-$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU).iso
171 GNUCOMMON=$(AROSDIR)/Development
172 GCCSCRIPT=$(GNUCOMMON)/S/Package-Startup
174 #TODO: it depend on all files in workbench dir
175 $(PORTSDIR)/aros$(AROS_TARGET_SUFFIX)-$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU).iso: $(BINDIR)/boot/aros-pc-i386.gz $(BINDIR)/boot/grub/menu.lst $(BINDIR)/boot/grub/menu.lst.DH0
176         @$(CP) $(TOP)/workbench/s/Startup-Sequence $(AROSDIR)/S/Startup-Sequence
177         @$(MKDIR) -p "$(AROSDIR)/Tools/Boot Disks"
178         @$(MKDIR) -p "$(PORTSDIR)"
179         @mkisofs -f \
180                 -o $(PORTSDIR)/aros$(AROS_TARGET_SUFFIX)-$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU).iso \
181                 -b boot/grub/iso9660_stage1_5 \
182                 -c boot/boot.catalog \
183                 -no-emul-boot \
184                 -boot-load-size 4 \
185                 -boot-info-table \
186                 -allow-leading-dots \
187                 -V "AROS Live CD" \
188                 -publisher "AROS Development Team" -R -J -sysid "AROS-$(AROS_TARGET_CPU)-$(AROS_TARGET_ARCH)" \
189                 -l -r \
190                 $(AROSDIR)
193 clean ::
194         -$(RM) $(TESTS)
196 $(OSGENDIR)/boot/%.o : %.c
197         %compile_q
199 $(OSGENDIR)/boot/%.o : %.s
200         @as $(INCLUDES) $< -o $@
202 $(OSGENDIR)/boot/%.o : $(LIBDIR)/%.a
203         @ld -r -d --whole-archive $< -o $@
205 $(OSGENDIR)/boot/%.d : %.c
206         %mkdepend_q
208 %common