source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/makefile@ 394

Last change on this file since 394 was 392, checked in by aitotat@…, 13 years ago

Changes to XTIDE Universal BIOS:

  • Greatly improved Hotkey Bar is displayed during drive detection.
  • 8k builds no longer include boot menu.
  • Boot menu is displayed only if F2 is pressed during drive detection.
  • Some changes to directory structure.


File size: 9.7 KB
RevLine 
[379]1##################################################################################################
2# Makefile to build XTIDE Universal BIOS. #
3# #
4# Valid makefile targets are: #
[389]5# all Removes existing files and builds binary files in \Build #
6# small Builds 8 kiB binaries only (without checksum) #
7# large Builds 15 kiB binaries only (without checksum) #
8# clean Removes all files from \Build #
9# checksum* Builds all and then generates checksum byte to all binary files #
10# strings* Compress src\Strings.asm to src\StringsCompressed.asm #
[379]11# #
12# * at the end of target name means that Perl is required for the job. #
13# Build directory must be created manually if it does not exist. #
14# #
15# #
16# Following modules can be included or excluded: #
17# MODULE_ADVANCED_ATA Native support for some VLB IDE controllers #
[380]18# MODULE_BOOT_MENU Boot Menu for selection of drive to boot from #
19# MODULE_EBIOS Enhanced functions for accessing drives over 8.4 GB #
[379]20# MODULE_JRIDE Support for JR-IDE/ISA #
21# MODULE_SERIAL Virtual hard disks using serial port #
[380]22# MODULE_SERIAL_FLOPPY Virtual floppy drives using serial port (requires MODULE_SERIAL) #
23# MODULE_STRINGS_COMPRESSED Use compressed strings to save space #
[379]24# #
25# Not modules but these affect the assembly: #
[380]26# ELIMINATE_CGA_SNOW Prevents CGA snowing at the cost of a few bytes #
[379]27# USE_186 Use instructions supported by 80188/80186 and V20/V30 and later #
28# USE_286 Use instructions supported by 286 and later #
29# USE_386 Use instructions supported by 386 and later #
30# USE_AT Use features supported on AT and later systems (not available on XT) #
31# #
32##################################################################################################
[3]33
34###########################################
35# Source files and destination executable #
36###########################################
37
38# Assembly source code file (*.asm):
39SRC_ASM = Src/Main.asm
40
41# Program executable file name without extension:
42PROG = ide
43
44
45#######################################
46# Destination and include directories #
47#######################################
48
49# Directory where binary file will be compiled to
50BUILD_DIR = Build
51
52# Subdirectories where included files are:
53HEADERS = Inc/
[363]54HEADERS += Inc/Controllers/
[3]55HEADERS += Src/
56HEADERS += Src/Handlers/
57HEADERS += Src/Handlers/Int13h/
[165]58HEADERS += Src/Handlers/Int13h/EBIOS/
59HEADERS += Src/Handlers/Int13h/Tools/
[392]60HEADERS += Src/Handlers/Int19h/
[150]61HEADERS += Src/Device/
62HEADERS += Src/Device/IDE/
[238]63HEADERS += Src/Device/MemoryMappedIDE/
[150]64HEADERS += Src/Device/Serial/
[3]65HEADERS += Src/Initialization/
[392]66HEADERS += Src/Initialization/AdvancedAta/
67HEADERS += Src/Menus/
68HEADERS += Src/Menus/BootMenu/
[3]69HEADERS += Src/Libraries/
70HEADERS += Src/VariablesAndDPTs/
71
[88]72# Subdirectories where library files are:
73LIBS = ../Assembly_Library/Inc/
74LIBS += ../Assembly_Library/Src/
75LIBS += ../Assembly_Library/Src/Display/
76LIBS += ../Assembly_Library/Src/File/
77LIBS += ../Assembly_Library/Src/Keyboard/
78LIBS += ../Assembly_Library/Src/Menu/
79LIBS += ../Assembly_Library/Src/Menu/Dialog/
80LIBS += ../Assembly_Library/Src/String/
81LIBS += ../Assembly_Library/Src/Time/
82LIBS += ../Assembly_Library/Src/Util/
[277]83LIBS += ../Assembly_Library/Src/Serial/
[88]84LIBS += ../XTIDE_Universal_BIOS/Inc/
85HEADERS += $(LIBS)
[3]86
[88]87
[3]88#################################################################
89# Assembler preprocessor defines. #
90#################################################################
[392]91DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_EBIOS
[389]92
[272]93DEFINES_XT = ELIMINATE_CGA_SNOW MODULE_SERIAL MODULE_SERIAL_FLOPPY
[392]94DEFINES_XTPLUS = USE_186 ELIMINATE_CGA_SNOW MODULE_SERIAL MODULE_SERIAL_FLOPPY
95DEFINES_AT = USE_AT USE_286 MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_ADVANCED_ATA
[389]96
[392]97DEFINES_XT_LARGE = $(DEFINES_XT) MODULE_BOOT_MENU MODULE_JRIDE MODULE_ADVANCED_ATA
98DEFINES_XTPLUS_LARGE = $(DEFINES_XTPLUS) MODULE_BOOT_MENU MODULE_JRIDE MODULE_ADVANCED_ATA
99DEFINES_AT_LARGE = $(DEFINES_AT) MODULE_BOOT_MENU MODULE_JRIDE MODULE_ADVANCED_ATA
[389]100
[272]101DEFINES_JRIDE_8K = ELIMINATE_CGA_SNOW MODULE_JRIDE
[392]102DEFINES_386_8K = USE_AT USE_386 MODULE_ADVANCED_ATA
[3]103
104
105###################
106# Other variables #
107###################
108
[239]109# Target size of the ROM, used in main.asm for number of 512B blocks and by checksum Perl script below
110ROMSIZE = 8192
111ROMSIZE_LARGE = 15360
112
[3]113# Add -D in front of every preprocessor define declaration
[389]114DEFS = $(DEFINES_COMMON:%=-D%)
[239]115DEFS_XT = $(DEFINES_XT:%=-D%) -DROMSIZE=$(ROMSIZE)
116DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%) -DROMSIZE=$(ROMSIZE)
117DEFS_AT = $(DEFINES_AT:%=-D%) -DROMSIZE=$(ROMSIZE)
118DEFS_XT_LARGE = $(DEFINES_XT_LARGE:%=-D%) -DROMSIZE=$(ROMSIZE_LARGE)
119DEFS_XTPLUS_LARGE = $(DEFINES_XTPLUS_LARGE:%=-D%) -DROMSIZE=$(ROMSIZE_LARGE)
120DEFS_AT_LARGE = $(DEFINES_AT_LARGE:%=-D%) -DROMSIZE=$(ROMSIZE_LARGE)
[272]121DEFS_JRIDE_8K = $(DEFINES_JRIDE_8K:%=-D%) -DROMSIZE=$(ROMSIZE)
[366]122DEFS_386_8K = $(DEFINES_386_8K:%=-D%) -DROMSIZE=$(ROMSIZE)
[3]123
124# Add -I in front of all header directories
125IHEADERS = $(HEADERS:%=-I%)
126
[145]127# Path + target file to be built
[3]128TARGET = $(BUILD_DIR)/$(PROG)
129
130#########################
131# Compilers and linkers #
132#########################
133
134# Make
135MAKE = mingw32-make.exe
136
137# Assembler
[188]138AS = nasm.exe
[3]139
140# use this command to erase files.
141RM = -del /Q
142
143
144#############################
145# Compiler and linker flags #
146#############################
147
148# Assembly compiler flags
149ASFLAGS = -f bin # Produce binary object files
150ASFLAGS += $(DEFS) # Preprocessor defines
151ASFLAGS += $(IHEADERS) # Set header file directory paths
152ASFLAGS += -Worphan-labels # Warn about labels without colon
[379]153ASFLAGS += -Ox # Optimize operands to their shortest forms
[3]154
155
156############################################
157# Build process. Actual work is done here. #
158############################################
159
[272]160all: clean small large
[145]161 @echo All done!
[3]162
[366]163small: at xtplus xt jride_8k 386_8k
[294]164 @echo All 8 kiB binaries built!
[272]165
166large: at_large xtplus_large xt_large
[294]167 @echo All 15 kiB binaries built!
[272]168
[3]169at:
[80]170 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT) -l"$(TARGET)_at.lst" -o"$(TARGET)_at.bin"
[272]171 @echo * 8k AT version "$(TARGET)_at.bin" built.
[3]172
[238]173at_large:
174 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT_LARGE) -l"$(TARGET)_atl.lst" -o"$(TARGET)_atl.bin"
[272]175 @echo *15k AT version "$(TARGET)_atl.bin" built.
[238]176
[3]177xtplus:
[80]178 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS) -l"$(TARGET)_xtp.lst" -o"$(TARGET)_xtp.bin"
[294]179 @echo * 8k XT Plus version "$(TARGET)_xtp.bin" built.
[3]180
[238]181xtplus_large:
182 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS_LARGE) -l"$(TARGET)_xtpl.lst" -o"$(TARGET)_xtpl.bin"
[294]183 @echo *15k XT Plus version "$(TARGET)_xtpl.bin" built.
[238]184
[3]185xt:
[80]186 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -l"$(TARGET)_xt.lst" -o"$(TARGET)_xt.bin"
[272]187 @echo * 8k XT version "$(TARGET)_xt.bin" built.
[3]188
[238]189xt_large:
190 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT_LARGE) -l"$(TARGET)_xtl.lst" -o"$(TARGET)_xtl.bin"
[272]191 @echo *15k XT version "$(TARGET)_xtl.bin" built.
[277]192
[272]193jride_8k:
194 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_JRIDE_8K) -l"$(TARGET)_jr8k.lst" -o"$(TARGET)_jr8k.bin"
195 @echo * 8k JR-IDE/ISA version "$(TARGET)_jr8k.bin" built.
[238]196
[366]197386_8k:
198 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_386_8K) -l"$(TARGET)_386.lst" -o"$(TARGET)_386.bin"
199 @echo * 8k 386 version "$(TARGET)_386.bin" built.
200
[322]201strings: src\Strings.asm
202 @$(AS) src\Strings.asm $(ASFLAGS) $(DEFS_XT) -DCHECK_FOR_UNUSED_ENTRYPOINTS -DMODULE_STRINGS_COMPRESSED_PRECOMPRESS -o build\Strings.bin -l build\StringsPrecompress.lst
203 @perl ..\tools\StringsCompress.pl < build\StringsPrecompress.lst > src\StringsCompressed.asm
204 @echo StringsCompressed.asm updated!
[252]205
[3]206clean:
207 @$(RM) $(BUILD_DIR)\*.*
208 @echo Deleted "(*.*)" from "$(BUILD_DIR)/"
[186]209
[294]210checksum: all
[240]211 @perl ..\tools\checksum.pl $(TARGET)_atl.bin $(ROMSIZE_LARGE)
212 @perl ..\tools\checksum.pl $(TARGET)_xtpl.bin $(ROMSIZE_LARGE)
213 @perl ..\tools\checksum.pl $(TARGET)_xtl.bin $(ROMSIZE_LARGE)
[203]214 @perl ..\tools\checksum.pl $(TARGET)_at.bin $(ROMSIZE)
215 @perl ..\tools\checksum.pl $(TARGET)_xtp.bin $(ROMSIZE)
216 @perl ..\tools\checksum.pl $(TARGET)_xt.bin $(ROMSIZE)
[272]217 @perl ..\tools\checksum.pl $(TARGET)_jr8k.bin $(ROMSIZE)
[369]218 @perl ..\tools\checksum.pl $(TARGET)_386.bin $(ROMSIZE)
[203]219
[252]220xt_unused: xt
[370]221 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt_unused.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS
222 @perl ..\tools\unused.pl $(TARGET)_xt.lst $(TARGET)_xt_unused.asm
[194]223
Note: See TracBrowser for help on using the repository browser.