source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/makefile@ 206

Last change on this file since 206 was 203, checked in by gregli@…, 13 years ago

Reworked the 'skip detecting the slave if there was no master' code to be more complete (includes configurator drives) and to take into account int13h/25h calls. Some of the changes in my last checkin have been rolled back as a result (they are no longer needed). I did take a byte out of RAMVARS, but there was an alignment byte available for the taking. I also added a perl script for padding and adding the checksum byte to a binary image, which can be invoked manually or with 'make checksum'.

File size: 5.4 KB
RevLine 
[3]1###############################################################################
2# Generic makefile for building BIOS binary file. #
3# v. 1.0.0 (28.7.2007 ... 28.7.2007) #
4# (C) Tomi Tilli #
5# aitotat@gmail.com #
6# #
7# Valid makefile targets are: #
8# all Removes existing files and builds binary file in \Build #
9# build Builds binary file in \Build #
10# clean Removes all files from \Build #
11# #
12# Build directory must be created manually if it does not exist. #
13# #
14###############################################################################
15
16###########################################
17# Source files and destination executable #
18###########################################
19
20# Assembly source code file (*.asm):
21SRC_ASM = Src/Main.asm
22
23# Program executable file name without extension:
24PROG = ide
25
26
27#######################################
28# Destination and include directories #
29#######################################
30
31# Directory where binary file will be compiled to
32BUILD_DIR = Build
33
34# Subdirectories where included files are:
35HEADERS = Inc/
36HEADERS += Src/
37HEADERS += Src/Boot/
38HEADERS += Src/Handlers/
39HEADERS += Src/Handlers/Int13h/
[165]40HEADERS += Src/Handlers/Int13h/EBIOS/
41HEADERS += Src/Handlers/Int13h/Tools/
[150]42HEADERS += Src/Device/
43HEADERS += Src/Device/IDE/
44HEADERS += Src/Device/Serial/
[3]45HEADERS += Src/Initialization/
46HEADERS += Src/Libraries/
47HEADERS += Src/VariablesAndDPTs/
48
[88]49# Subdirectories where library files are:
50LIBS = ../Assembly_Library/Inc/
51LIBS += ../Assembly_Library/Src/
52LIBS += ../Assembly_Library/Src/Display/
53LIBS += ../Assembly_Library/Src/File/
54LIBS += ../Assembly_Library/Src/Keyboard/
55LIBS += ../Assembly_Library/Src/Menu/
56LIBS += ../Assembly_Library/Src/Menu/Dialog/
57LIBS += ../Assembly_Library/Src/String/
58LIBS += ../Assembly_Library/Src/Time/
59LIBS += ../Assembly_Library/Src/Util/
60LIBS += ../XTIDE_Universal_BIOS/Inc/
61HEADERS += $(LIBS)
[3]62
[88]63
[3]64#################################################################
65# Assembler preprocessor defines. #
66#################################################################
[186]67DEFINES = INCLUDE_MENU_LIBRARY EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS MODULE_EBIOS MODULE_SERIAL MODULE_STRINGS_COMPRESSED
[88]68DEFINES_XT = ELIMINATE_CGA_SNOW
69DEFINES_XTPLUS = ELIMINATE_CGA_SNOW USE_186
[3]70DEFINES_AT = USE_186 USE_286 USE_AT
71
72
73###################
74# Other variables #
75###################
76
77# Add -D in front of every preprocessor define declaration
78DEFS = $(DEFINES:%=-D%)
79DEFS_XT = $(DEFINES_XT:%=-D%)
80DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%)
81DEFS_AT = $(DEFINES_AT:%=-D%)
82
83# Add -I in front of all header directories
84IHEADERS = $(HEADERS:%=-I%)
85
[145]86# Path + target file to be built
[3]87TARGET = $(BUILD_DIR)/$(PROG)
88
[203]89# Target size of the ROM, used by checksum Perl script
90ROMSIZE = 8192
[3]91
92#########################
93# Compilers and linkers #
94#########################
95
96# Make
97MAKE = mingw32-make.exe
98
99# Assembler
[188]100AS = nasm.exe
[3]101
102# use this command to erase files.
103RM = -del /Q
104
105
106#############################
107# Compiler and linker flags #
108#############################
109
110# Assembly compiler flags
111ASFLAGS = -f bin # Produce binary object files
112ASFLAGS += $(DEFS) # Preprocessor defines
113ASFLAGS += $(IHEADERS) # Set header file directory paths
114ASFLAGS += -Worphan-labels # Warn about labels without colon
115ASFLAGS += -O9 # Optimize operands to their shortest forms
116
117
118############################################
119# Build process. Actual work is done here. #
120############################################
121
122.PHONY: all at xtplus xt clean
123
124# Make clean debug and release versions
[61]125all: clean at xtplus xt
[145]126 @echo All done!
[3]127
128at:
[80]129 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT) -l"$(TARGET)_at.lst" -o"$(TARGET)_at.bin"
[145]130 @echo AT version "$(TARGET)_at.bin" built.
[3]131
132xtplus:
[80]133 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS) -l"$(TARGET)_xtp.lst" -o"$(TARGET)_xtp.bin"
[145]134 @echo XT plus version "$(TARGET)_xtp.bin" built.
[3]135
136xt:
[80]137 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -l"$(TARGET)_xt.lst" -o"$(TARGET)_xt.bin"
[145]138 @echo XT version "$(TARGET)_xt.bin" built.
[3]139
140clean:
141 @$(RM) $(BUILD_DIR)\*.*
142 @echo Deleted "(*.*)" from "$(BUILD_DIR)/"
[186]143
[203]144checksum: all
145 @perl ..\tools\checksum.pl $(TARGET)_at.bin $(ROMSIZE)
146 @perl ..\tools\checksum.pl $(TARGET)_xtp.bin $(ROMSIZE)
147 @perl ..\tools\checksum.pl $(TARGET)_xt.bin $(ROMSIZE)
148
[197]149src\StringsCompressed.asm: src\Strings.asm
[203]150 @$(AS) src\Strings.asm $(ASFLAGS) $(DEFS_XT) -DMODULE_STRINGS_COMPRESSED_PRECOMPRESS -o build\Strings.bin -l build\StringsPrecompress.lst
151 @perl ..\tools\StringsCompress.pl < build\StringsPrecompress.lst > src\StringsCompressed.asm
152 @echo StringsCompressed.asm updated!
[186]153
[194]154$(SRC_ASM): src\StringsCompressed.asm
155
156xt_unused: xt
157 $(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt_unused.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS
158 perl ..\tools\unused.pl $(TARGET)_xt.lst $(TARGET)_xt_unused.asm
159
Note: See TracBrowser for help on using the repository browser.