source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/makefile@ 365

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

Changes to XTIDE Universal BIOS:

  • Added Advanced ATA Module (MODULE_ADVANCED_ATA) with native support for QDI Vision QD6500 and QD6580 VLB IDE Controllers.
  • Hopefully optimized IDE transfer functions for 8088 (replaced some memory accesses from WORD to BYTE).
  • XT build does not fit in 8k at the moment!!!
File size: 7.2 KB
RevLine 
[3]1###############################################################################
[252]2# Makefile to build XTIDE Universal BIOS. #
[3]3# #
4# Valid makefile targets are: #
[272]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) #
[3]8# clean Removes all files from \Build #
[252]9# checksum* Builds all and then generates checksum byte to all binary files #
10# strings* Compress src\strings.asm to src\StringsCompressed.asm #
[3]11# #
[252]12# * at the end of target name means that Perl is required for the job. #
[3]13# Build directory must be created manually if it does not exist. #
14# #
15###############################################################################
16
17###########################################
18# Source files and destination executable #
19###########################################
20
21# Assembly source code file (*.asm):
22SRC_ASM = Src/Main.asm
23
24# Program executable file name without extension:
25PROG = ide
26
27
28#######################################
29# Destination and include directories #
30#######################################
31
32# Directory where binary file will be compiled to
33BUILD_DIR = Build
34
35# Subdirectories where included files are:
36HEADERS = Inc/
[363]37HEADERS += Inc/Controllers/
[3]38HEADERS += Src/
39HEADERS += Src/Boot/
40HEADERS += Src/Handlers/
41HEADERS += Src/Handlers/Int13h/
[165]42HEADERS += Src/Handlers/Int13h/EBIOS/
43HEADERS += Src/Handlers/Int13h/Tools/
[150]44HEADERS += Src/Device/
45HEADERS += Src/Device/IDE/
[238]46HEADERS += Src/Device/MemoryMappedIDE/
[150]47HEADERS += Src/Device/Serial/
[3]48HEADERS += Src/Initialization/
49HEADERS += Src/Libraries/
50HEADERS += Src/VariablesAndDPTs/
51
[88]52# Subdirectories where library files are:
53LIBS = ../Assembly_Library/Inc/
54LIBS += ../Assembly_Library/Src/
55LIBS += ../Assembly_Library/Src/Display/
56LIBS += ../Assembly_Library/Src/File/
57LIBS += ../Assembly_Library/Src/Keyboard/
58LIBS += ../Assembly_Library/Src/Menu/
59LIBS += ../Assembly_Library/Src/Menu/Dialog/
60LIBS += ../Assembly_Library/Src/String/
61LIBS += ../Assembly_Library/Src/Time/
62LIBS += ../Assembly_Library/Src/Util/
[277]63LIBS += ../Assembly_Library/Src/Serial/
[88]64LIBS += ../XTIDE_Universal_BIOS/Inc/
65HEADERS += $(LIBS)
[3]66
[88]67
[3]68#################################################################
69# Assembler preprocessor defines. #
70#################################################################
[272]71DEFINES = INCLUDE_MENU_LIBRARY EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS MODULE_EBIOS MODULE_STRINGS_COMPRESSED
72DEFINES_XT = ELIMINATE_CGA_SNOW MODULE_SERIAL MODULE_SERIAL_FLOPPY
73DEFINES_XTPLUS = ELIMINATE_CGA_SNOW USE_186 MODULE_SERIAL MODULE_SERIAL_FLOPPY
[363]74DEFINES_AT = USE_286 USE_AT MODULE_ADVANCED_ATA
[238]75DEFINES_XT_LARGE = $(DEFINES_XT) MODULE_JRIDE
76DEFINES_XTPLUS_LARGE = $(DEFINES_XTPLUS) MODULE_JRIDE
77DEFINES_AT_LARGE = $(DEFINES_AT) MODULE_JRIDE
[272]78DEFINES_JRIDE_8K = ELIMINATE_CGA_SNOW MODULE_JRIDE
[3]79
80
81###################
82# Other variables #
83###################
84
[239]85# Target size of the ROM, used in main.asm for number of 512B blocks and by checksum Perl script below
86ROMSIZE = 8192
87ROMSIZE_LARGE = 15360
88
[3]89# Add -D in front of every preprocessor define declaration
[294]90DEFS = $(DEFINES:%=-D%)
[239]91DEFS_XT = $(DEFINES_XT:%=-D%) -DROMSIZE=$(ROMSIZE)
92DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%) -DROMSIZE=$(ROMSIZE)
93DEFS_AT = $(DEFINES_AT:%=-D%) -DROMSIZE=$(ROMSIZE)
94DEFS_XT_LARGE = $(DEFINES_XT_LARGE:%=-D%) -DROMSIZE=$(ROMSIZE_LARGE)
95DEFS_XTPLUS_LARGE = $(DEFINES_XTPLUS_LARGE:%=-D%) -DROMSIZE=$(ROMSIZE_LARGE)
96DEFS_AT_LARGE = $(DEFINES_AT_LARGE:%=-D%) -DROMSIZE=$(ROMSIZE_LARGE)
[272]97DEFS_JRIDE_8K = $(DEFINES_JRIDE_8K:%=-D%) -DROMSIZE=$(ROMSIZE)
[3]98
99# Add -I in front of all header directories
100IHEADERS = $(HEADERS:%=-I%)
101
[145]102# Path + target file to be built
[3]103TARGET = $(BUILD_DIR)/$(PROG)
104
105#########################
106# Compilers and linkers #
107#########################
108
109# Make
110MAKE = mingw32-make.exe
111
112# Assembler
[188]113AS = nasm.exe
[3]114
115# use this command to erase files.
116RM = -del /Q
117
118
119#############################
120# Compiler and linker flags #
121#############################
122
123# Assembly compiler flags
124ASFLAGS = -f bin # Produce binary object files
125ASFLAGS += $(DEFS) # Preprocessor defines
126ASFLAGS += $(IHEADERS) # Set header file directory paths
127ASFLAGS += -Worphan-labels # Warn about labels without colon
128ASFLAGS += -O9 # Optimize operands to their shortest forms
129
130
131############################################
132# Build process. Actual work is done here. #
133############################################
134
[272]135all: clean small large
[145]136 @echo All done!
[3]137
[272]138small: at xtplus xt jride_8k
[294]139 @echo All 8 kiB binaries built!
[272]140
141large: at_large xtplus_large xt_large
[294]142 @echo All 15 kiB binaries built!
[272]143
[3]144at:
[80]145 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT) -l"$(TARGET)_at.lst" -o"$(TARGET)_at.bin"
[272]146 @echo * 8k AT version "$(TARGET)_at.bin" built.
[3]147
[238]148at_large:
149 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT_LARGE) -l"$(TARGET)_atl.lst" -o"$(TARGET)_atl.bin"
[272]150 @echo *15k AT version "$(TARGET)_atl.bin" built.
[238]151
[3]152xtplus:
[80]153 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS) -l"$(TARGET)_xtp.lst" -o"$(TARGET)_xtp.bin"
[294]154 @echo * 8k XT Plus version "$(TARGET)_xtp.bin" built.
[3]155
[238]156xtplus_large:
157 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS_LARGE) -l"$(TARGET)_xtpl.lst" -o"$(TARGET)_xtpl.bin"
[294]158 @echo *15k XT Plus version "$(TARGET)_xtpl.bin" built.
[238]159
[3]160xt:
[80]161 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -l"$(TARGET)_xt.lst" -o"$(TARGET)_xt.bin"
[272]162 @echo * 8k XT version "$(TARGET)_xt.bin" built.
[3]163
[238]164xt_large:
165 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT_LARGE) -l"$(TARGET)_xtl.lst" -o"$(TARGET)_xtl.bin"
[272]166 @echo *15k XT version "$(TARGET)_xtl.bin" built.
[277]167
[272]168jride_8k:
169 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_JRIDE_8K) -l"$(TARGET)_jr8k.lst" -o"$(TARGET)_jr8k.bin"
170 @echo * 8k JR-IDE/ISA version "$(TARGET)_jr8k.bin" built.
[238]171
[322]172strings: src\Strings.asm
173 @$(AS) src\Strings.asm $(ASFLAGS) $(DEFS_XT) -DCHECK_FOR_UNUSED_ENTRYPOINTS -DMODULE_STRINGS_COMPRESSED_PRECOMPRESS -o build\Strings.bin -l build\StringsPrecompress.lst
174 @perl ..\tools\StringsCompress.pl < build\StringsPrecompress.lst > src\StringsCompressed.asm
175 @echo StringsCompressed.asm updated!
[252]176
[3]177clean:
178 @$(RM) $(BUILD_DIR)\*.*
179 @echo Deleted "(*.*)" from "$(BUILD_DIR)/"
[186]180
[294]181checksum: all
[240]182 @perl ..\tools\checksum.pl $(TARGET)_atl.bin $(ROMSIZE_LARGE)
183 @perl ..\tools\checksum.pl $(TARGET)_xtpl.bin $(ROMSIZE_LARGE)
184 @perl ..\tools\checksum.pl $(TARGET)_xtl.bin $(ROMSIZE_LARGE)
[203]185 @perl ..\tools\checksum.pl $(TARGET)_at.bin $(ROMSIZE)
186 @perl ..\tools\checksum.pl $(TARGET)_xtp.bin $(ROMSIZE)
187 @perl ..\tools\checksum.pl $(TARGET)_xt.bin $(ROMSIZE)
[272]188 @perl ..\tools\checksum.pl $(TARGET)_jr8k.bin $(ROMSIZE)
[203]189
[252]190xt_unused: xt
[194]191 $(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt_unused.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS
192 perl ..\tools\unused.pl $(TARGET)_xt.lst $(TARGET)_xt_unused.asm
193
Note: See TracBrowser for help on using the repository browser.