source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/makefile@ 10

Last change on this file since 10 was 10, checked in by Tomi Tilli, 15 years ago

Now assembles with Yasm

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 = yasm.exe
82#AS = nasm.exe
83
84# use this command to erase files.
85RM = -del /Q
86
87
88#############################
89# Compiler and linker flags #
90#############################
91
92# Assembly compiler flags
93ASFLAGS = -f bin # Produce binary object files
94ASFLAGS += $(DEFS) # Preprocessor defines
95ASFLAGS += $(IHEADERS) # Set header file directory paths
96ASFLAGS += -Worphan-labels # Warn about labels without colon
97ASFLAGS += -O9 # Optimize operands to their shortest forms
98
99
100############################################
101# Build process. Actual work is done here. #
102############################################
103
104.PHONY: all at xtplus xt clean
105
106# Make clean debug and release versions
107all: clean at xtplus xt
108 @echo All build!
109
110at:
111 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT) -o"$(TARGET)_at.bin"
112 @echo AT version "$(TARGET)_at.bin" build.
113
114xtplus:
115 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS) -o"$(TARGET)_xtp.bin"
116 @echo XT plus version "$(TARGET)_xtp.bin" build.
117
118xt:
119 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt.bin"
120 @echo XT version "$(TARGET)_xt.bin" build.
121
122clean:
123 @$(RM) $(BUILD_DIR)\*.*
124 @echo Deleted "(*.*)" from "$(BUILD_DIR)/"
Note: See TracBrowser for help on using the repository browser.