source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/makefile @ 80

Last change on this file since 80 was 80, checked in by aitotat, 13 years ago

Changes to XTIDE Universal BIOS:

  • Makefile now uses Nasm (instead of Yasm)
  • Makefile now generates listing files
File size: 3.9 KB
Line 
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/
40HEADERS += Src/Handlers/Int13h/Common/
41HEADERS += Src/Initialization/
42HEADERS += Src/Libraries/
43HEADERS += Src/Libraries/menu/
44HEADERS += Src/VariablesAndDPTs/
45
46
47#################################################################
48# Assembler preprocessor defines.                               #
49#################################################################
50DEFINES =
51DEFINES_XT = 
52DEFINES_XTPLUS = USE_186
53DEFINES_AT = USE_186 USE_286 USE_AT
54
55
56###################
57# Other variables #
58###################
59
60# Add -D in front of every preprocessor define declaration
61DEFS = $(DEFINES:%=-D%)
62DEFS_XT = $(DEFINES_XT:%=-D%)
63DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%)
64DEFS_AT = $(DEFINES_AT:%=-D%)
65
66# Add -I in front of all header directories
67IHEADERS = $(HEADERS:%=-I%)
68
69# Path + target file to be build
70TARGET = $(BUILD_DIR)/$(PROG)
71
72
73#########################
74# Compilers and linkers #
75#########################
76
77# Make
78MAKE = mingw32-make.exe
79
80# Assembler
81AS = nasm.exe
82
83# use this command to erase files.
84RM = -del /Q
85
86
87#############################
88# Compiler and linker flags #
89#############################
90
91# Assembly compiler flags
92ASFLAGS = -f bin                # Produce binary object files
93ASFLAGS += $(DEFS)              # Preprocessor defines
94ASFLAGS += $(IHEADERS)          # Set header file directory paths
95ASFLAGS += -Worphan-labels      # Warn about labels without colon
96ASFLAGS += -O9                  # Optimize operands to their shortest forms
97
98
99############################################
100# Build process. Actual work is done here. #
101############################################
102
103.PHONY: all at xtplus xt clean
104
105# Make clean debug and release versions
106all: clean at xtplus xt
107    @echo All build!
108
109at:
110    @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT) -l"$(TARGET)_at.lst" -o"$(TARGET)_at.bin"
111    @echo AT version "$(TARGET)_at.bin" build.
112
113xtplus:
114    @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS) -l"$(TARGET)_xtp.lst" -o"$(TARGET)_xtp.bin"
115    @echo XT plus version "$(TARGET)_xtp.bin" build.
116
117xt:
118    @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -l"$(TARGET)_xt.lst" -o"$(TARGET)_xt.bin"
119    @echo XT version "$(TARGET)_xt.bin" build.
120
121clean:
122    @$(RM) $(BUILD_DIR)\*.*
123    @echo Deleted "(*.*)" from "$(BUILD_DIR)/"
Note: See TracBrowser for help on using the repository browser.