Indentation fix, cleanup.
[AROS.git] / arch / i386-pc / boot / floppy / mmakefile.src
bloba87752e32a1a3ab42499ab1544295a4ed7bf1099
1 # $Id$
3 include $(SRCDIR)/config/aros.cfg
5 .PHONY: $(DISTDIR)/aros-pc-i386.img $(DISTDIR)/system-pc-i386.img
7 #MM bootdisk-pc-i386 : AROS             \
8 #MM                     bootdisk-setup-pc-i386 \
9 #MM                     kernel-link-pc-i386 \
10 #MM                     bootloader-$(AROS_TARGET_BOOTLOADER)-$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)
12 #MM systemdisk-pc-i386 : AROS           \
13 #MM                     systemdisk-setup-pc-i386 \
14 #MM                     bootloader-$(AROS_TARGET_BOOTLOADER)-$(AROS_TARGET_ARCH)-$(AROS_TARGET_CPU)
16 SYSTEM_FILES := \
17     AROS.boot \
18     C/Unpack \
19     L/UserShell-Seg \
20     Libs/iffparse.library \
21     Libs/locale.library
23 MODULES_DEFAULT := $(SRCDIR)/$(CURDIR)/../modules.default
24 MODULE_BOOTSTRAP := /$(AROS_DIR_ARCH)/bootstrap.gz
25 MODULE_LEGACY := /$(AROS_DIR_ARCH)/aros-legacy.pkg.gz
26 BOOT_FILES := $(MODULE_BOOTSTRAP) $(shell cat $(MODULES_DEFAULT)) \
27  $(MODULE_LEGACY)
29 BOOT_EXTRA_FILES :=
31 BOOT_TAR_EXECUTABLES := \
32     C/AddBuffers C/AddDataTypes C/Alias C/Ask C/Assign C/Avail C/Break C/CD \
33     C/ChangeTaskPri C/Copy C/Date C/Delete C/Dir C/DiskChange C/Echo C/Else \
34     C/EndCLI C/EndIf C/EndSkip C/Execute C/FailAt C/Fault C/Filenote System/Format \
35     C/Get C/Getenv C/IPrefs C/If C/Info C/Join C/Lab C/List \
36     C/MakeDir C/MakeLink C/Mount C/NewShell C/Path C/Prompt C/Protect C/Quit \
37     C/Reboot C/Relabel C/Rename C/Resident C/Run C/Search C/Set C/SetClock \
38     C/SetDate C/Setenv C/Skip C/Stack C/Status C/Touch C/Type C/Unalias \
39     C/Unset C/Unsetenv C/Version C/Which C/Why C/install-i386-pc \
40     C/Partition \
41     Classes/DataTypes/ascii.datatype \
42     Classes/DataTypes/binary.datatype \
43     Classes/DataTypes/text.datatype \
44     Classes/DataTypes/picture.datatype \
45     Classes/DataTypes/ilbm.datatype \
46     Classes/DataTypes/png.datatype \
47     Classes/Zune/AboutWindow.mcc \
48     Classes/Zune/Calendar.mcc \
49     Classes/Zune/Clock.mcc \
50     Classes/Zune/IconDrawerList.mui \
51     Classes/Zune/IconImage.mcc \
52     Classes/Zune/IconList.mui \
53     Classes/Zune/IconListview.mui \
54     Classes/Zune/IconDrawerList.mui \
55     Classes/Zune/IconVolumeList.mui Classes/Zune/PrefsWindow.mcc \
56     Classes/Zune/PrefsEditor.mcc Classes/Zune/SystemPrefsWindow.mcc \
57     Devs/clipboard.device \
58     Devs/serial.device \
59     L/pipe-handler \
60     Libs/stdc.library Libs/stdcio.library Libs/posixc.library \
61     Libs/png.library Libs/z1.library Libs/uuid.library \
62     Libs/asl.library Libs/commodities.library \
63     Libs/cybergraphics.library \
64     Libs/datatypes.library Libs/diskfont.library Libs/gadtools.library \
65     Libs/icon.library Libs/kms.library Libs/workbench.library \
66     Libs/reqtools.library Libs/muimaster.library Libs/coolimages.library \
67     Prefs/Font \
68     Prefs/Time \
69     System/About System/FixFonts \
70     System/Wanderer/Wanderer \
71     System/Wanderer/Tools/DiskInfo \
72     System/Wanderer/Tools/ExecuteCommand \
73     System/Wanderer/Tools/ExecuteStartup \
74     System/Wanderer/Tools/Info System/Wanderer/Tools/WBNewDrawer \
75     System/Wanderer/Tools/WBRename \
76     Tools/HDToolBox \
77     Tools/Debug/sashimi \
78     Utilities/MultiView
81 BOOT_TAR_ICONS := \
82     Devs.info \
83     Fonts.info \
84     Locale.info \
85     Prefs.info \
86     Prefs/Font.info \
87     Prefs/Time.info \
88     System.info \
89     System/FixFonts.info \
90     System/Wanderer/Wanderer.info \
91     System/Wanderer/Tools/DiskInfo.info \
92     System/Wanderer/Tools/ExecuteCommand.info System/Wanderer/Tools/Info.info \
93     System/Wanderer/Tools/WBNewDrawer.info System/Wanderer/Tools/WBRename.info \
94     Tools.info \
95     Tools/HDToolBox.info \
96     Tools/Debug.info \
97     Tools/Debug/Sashimi.info \
98     Utilities.info
101 BOOT_TAR_MISC := \
102     Devs/DataTypes/ELF Devs/DataTypes/ELF_EXE Devs/DataTypes/ILBM \
103     Devs/DataTypes/FTXT Devs/DOSDrivers/PIPE \
104     Devs/Keymaps Devs/Mountlist \
105     Fonts/fixed/8 Fonts/arial/13 Fonts/ttcourier/14 \
106     Locale/Countries \
107     Prefs/Env-Archive/hdtoolbox.prefs \
108     Prefs/Env-Archive/SYS/font.prefs Prefs/Env-Archive/SYS/theme.var \
109     Prefs/Env-Archive/SYS/def_Disk.info \
110     Prefs/Env-Archive/SYS/def_Drawer.info \
111     Prefs/Env-Archive/SYS/def_Project.info \
112     Prefs/Env-Archive/SYS/def_RAM.info \
113     Prefs/Env-Archive/SYS/def_Tool.info \
114     Prefs/Presets/Themes/Mason \
115     Prefs/Presets/Themes/$(AROS_GUI_THEME) \
116     S
119 BOOT_SRC_DIR    := $(AROSDIR)
120 BOOT_DEST_DIR   := $(OSGENDIR)/boot/bootdisk
121 SYSTEM_DEST_DIR := $(OSGENDIR)/boot/systemdisk
123 ifeq ($(AROS_TARGET_BOOTLOADER),grub)
124 BOOT_FILES += $(AROS_DIR_ARCH)/grub/stage1
125 BOOT_TAR_MISC += $(AROS_DIR_ARCH)/grub/menu.lst.DH0 $(AROS_DIR_ARCH)/grub/stage2
126 BOOT_EXTRA_FILES += $(BOOT_DEST_DIR)/$(AROS_DIR_ARCH)/grub/stage2
128 $(BOOT_DEST_DIR)/$(AROS_DIR_ARCH)/grub/stage2 $(SYSTEM_DEST_DIR)/$(AROS_DIR_ARCH)/grub/stage2:
129         @$(CP) $(AROSARCHDIR)/grub/stage2_hdisk $@
130 endif
132 ifeq ($(AROS_TARGET_BOOTLOADER),grub2)
133 BOOT_FILES += $(AROS_DIR_ARCH)/grub/grub.cfg
134 BOOT_TAR_MISC += $(AROS_DIR_ARCH)/grub/grub.cfg
135 endif
137 BOOT_TAR_FILES := $(BOOT_TAR_EXECUTABLES) $(BOOT_TAR_ICONS) $(BOOT_TAR_MISC)
139 BOOT_DEST_FILES := $(foreach f, $(BOOT_FILES), $(BOOT_DEST_DIR)/$(f))
141 SYSTEM_DEST_FILES := $(foreach f, $(SYSTEM_FILES), $(SYSTEM_DEST_DIR)/$(f))
144 bootdisk-setup-pc-i386 :
145         @$(MKDIR) "$(AROSDIR)/Tools/Boot Disks"
146         -$(RM) $(BOOT_DEST_DIR)
147         %mkdirs_q $(BOOT_DEST_DIR)
148         %mkdirs_q $(BOOT_DEST_DIR)/$(AROS_DIR_ARCH)/grub
149         @$(ECHO) Generating $(SRCDIR)/$(CURDIR)/menu.lst...
150         @$(SED) -e \
151          's#@modules.default@#sed "s\#^\#    module \#g" $(MODULES_DEFAULT)#e' \
152          -e 's#@module.bootstrap@#$(MODULE_BOOTSTRAP)#g' \
153          $(SRCDIR)/$(CURDIR)/menu.lst \
154          > $(BOOT_DEST_DIR)/$(AROS_DIR_ARCH)/grub/menu.lst
157 systemdisk-setup-pc-i386 :
158         @$(MKDIR) "$(AROSDIR)/Tools/Boot Disks"
159         -$(RM) $(SYSTEM_DEST_DIR)
160         %mkdirs_q $(SYSTEM_DEST_DIR)
161         %mkdirs_q $(SYSTEM_DEST_DIR)/C
162         %mkdirs_q $(SYSTEM_DEST_DIR)/L
163         %mkdirs_q $(SYSTEM_DEST_DIR)/Libs
164         %mkdirs_q $(SYSTEM_DEST_DIR)/S
166 #MM workbench-boot-pc-i386
167 workbench-boot-pc-i386:
168         @$(NOP)
170 bootdisk-pc-i386: $(DISTDIR)/aros-pc-i386.img
171 systemdisk-pc-i386: $(DISTDIR)/system-pc-i386.img
173 .PHONY: bootdisk-pc-i386-quick systemdisk-pc-i386-quick
176 bootdisk-pc-i386-quick : bootdisk-pc-i386
179 systemdisk-pc-i386-quick : systemdisk-pc-i386
181 $(DISTDIR)/aros-pc-i386.img: $(BOOT_DEST_FILES) $(BOOT_EXTRA_FILES) \
182  $(AROSARCHDIR)/bootstrap.gz \
183  $(GENDIR)/$(CURDIR)/install-$(AROS_HOST_ARCH)-$(AROS_HOST_CPU)
184         @$(MKDIR) -p "$(DISTDIR)"
185         $(RM) $@
186         $(COPYTOAFS) $@ --name "AROS Boot Floppy" --size floppy1440 $(BOOT_DEST_DIR)
187         $(GENDIR)/$(CURDIR)/install-$(AROS_HOST_ARCH)-$(AROS_HOST_CPU) $@
189 $(DISTDIR)/system-pc-i386.img: $(SYSTEM_DEST_FILES) \
190  $(SYSTEM_DEST_DIR)/AROS.pkg $(SYSTEM_DEST_DIR)/S/Startup-Sequence
191         @$(MKDIR) -p "$(DISTDIR)"
192         $(RM) $@
193         $(COPYTOAFS) $@ --name "AROS Live Floppy" --size floppy1440 $(SYSTEM_DEST_DIR)
195 $(SYSTEM_DEST_DIR)/S/Startup-Sequence:
196         @$(CP) $(SRCDIR)/workbench/s/Startup-Sequence.DEMOFLOPPY $@
198 $(GENDIR)/$(CURDIR)/install-$(AROS_HOST_ARCH)-$(AROS_HOST_CPU): $(SRCDIR)/$(CURDIR)/install.c
199         echo $(GENDIR)/$(CURDIR)
200         @$(MKDIR) -p $(GENDIR)/$(CURDIR)
201         @$(HOST_CC) $(HOST_CFLAGS) $(SRCDIR)/$(CURDIR)/install.c -o $(GENDIR)/$(CURDIR)/install-$(AROS_HOST_ARCH)-$(AROS_HOST_CPU)
203 $(SYSTEM_DEST_DIR)/AROS.pkg : $(addprefix $(BOOT_SRC_DIR)/,$(BOOT_TAR_FILES))
204         @$(RM) -rf $(OSGENDIR)/boot/bootdisk.compressed
205         @$(MKDIR) -p $(OSGENDIR)/boot/bootdisk.compressed
206         @$(MKDIR) -p $(OSGENDIR)/boot/bootdisk.compressed/S
207         @$(CP) $(SRCDIR)/workbench/s/Startup-Sequence $(OSGENDIR)/boot/bootdisk.compressed/S/Startup-Sequence
208         @( \
209             oldpwd=$$PWD; \
210             cd $(BOOT_SRC_DIR) && \
211             for path in $(BOOT_TAR_EXECUTABLES); do \
212                 $(SH) $(SRCDIR)/$(CURDIR)/copypath $$path $(OSGENDIR)/boot/bootdisk.compressed ; \
213                                 $(TARGET_STRIP) --strip-unneeded -R .note -R .comment $(OSGENDIR)/boot/bootdisk.compressed/$$path ; \
214             done && \
215             for path in $(BOOT_TAR_ICONS); do \
216                 $(SH) $(SRCDIR)/$(CURDIR)/copypath $$path $(OSGENDIR)/boot/bootdisk.compressed ; \
217             done && \
218             for path in $(BOOT_TAR_MISC); do \
219                 $(SH) $(SRCDIR)/$(CURDIR)/copypath $$path $(OSGENDIR)/boot/bootdisk.compressed ; \
220             done && \
221             cd $(OSGENDIR)/boot/ && \
222             $(RM) AROS.pkg && \
223             $(SRCDIR)/tools/package/pkg c AROS.pkg bootdisk.compressed && \
224             bzip2 -9 AROS.pkg && \
225             mv -f AROS.pkg.bz2 $(SYSTEM_DEST_DIR)/AROS.pkg \
226         )
228 $(BOOT_DEST_DIR)/% : $(BOOT_SRC_DIR)/%
229         @$(CP) $< $@
231 $(SYSTEM_DEST_DIR)/% : $(BOOT_SRC_DIR)/%
232         @$(CP) $< $@
235 install-bootdisk :
236         @$(ECHO) "Insert blank floppy-disk in /dev/fd0 and press enter."
237         @read
238         @$(ECHO) "Writing AROS Boot Image to floppy..."
239         @dd if=$(DISTDIR)/aros-pc-i386.img of=/dev/fd0
242 install-systemdisk :
243         @$(ECHO) "Insert blank floppy-disk in /dev/fd0 and press enter."
244         @read
245         @$(ECHO) "Writing AROS System Image to floppy..."
246         @dd if=$(DISTDIR)/system-pc-i386.img of=/dev/fd0
249 install-pc-i386 :
250         @$(ECHO) -n "Copying AROS kernel to /aros/boot directory... "
251         @cp $(AROSARCHDIR)/kernel /aros/boot/kernel-pc-i386
252         @$(ECHO) "Done."
255 clean ::
256         -$(RM) $(TESTS)
258 %common