source: xtideuniversalbios/trunk/Assembly_Library/makefile@ 64

Last change on this file since 64 was 47, checked in by Tomi Tilli, 14 years ago

Assembly Library:
CGA snow prevention now works when copying strings on formatted printing.

File size: 3.9 KB
RevLine 
[41]1###############################################################################
2# Generic makefile for building BIOS binary file. #
3# v. 1.0.0 (28.7.2007 ... 27.6.2010) #
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/LibraryTests.asm
22#SRC_ASM = Src/LibSizeCheck.asm
23
24# Program executable file name without extension:
25PROG = test
26EXTENSION = com
27
28
29#######################################
30# Destination and include directories #
31#######################################
32
33# Directory where binary file will be compiled to
34BUILD_DIR = Build
35
36# Subdirectories where included files are:
37HEADERS = Inc/
38HEADERS += Src/
39HEADERS += Src/Display/
40HEADERS += Src/File/
41HEADERS += Src/Keyboard/
42HEADERS += Src/Menu/
43HEADERS += Src/Menu/Dialog/
44HEADERS += Src/String/
45HEADERS += Src/Time/
46HEADERS += Src/Util/
47
48
49#################################################################
50# Assembler preprocessor defines. #
51#################################################################
[47]52DEFINES =
53DEFINES_XT = ELIMINATE_CGA_SNOW
54DEFINES_XTPLUS = USE_186 ELIMINATE_CGA_SNOW
[41]55DEFINES_AT = USE_186 USE_286 USE_AT
56
57
58###################
59# Other variables #
60###################
61
62# Add -D in front of every preprocessor define declaration
63DEFS = $(DEFINES:%=-D%)
64DEFS_XT = $(DEFINES_XT:%=-D%)
65DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%)
66DEFS_AT = $(DEFINES_AT:%=-D%)
67
68# Add -I in front of all header directories
69IHEADERS = $(HEADERS:%=-I%)
70
71# Path + target file to be build
72TARGET = $(BUILD_DIR)/$(PROG)
73
74
75#########################
76# Compilers and linkers #
77#########################
78
79# Make
80MAKE = mingw32-make.exe
81
82# Assembler
83AS = yasm.exe
84#AS = nasm.exe
85
86# use this command to erase files.
87RM = -del /Q
88
89
90#############################
91# Compiler and linker flags #
92#############################
93
94# Assembly compiler flags
95ASFLAGS = -f bin # Produce binary object files
96ASFLAGS += $(DEFS) # Preprocessor defines
97ASFLAGS += $(IHEADERS) # Set header file directory paths
98ASFLAGS += -Worphan-labels # Warn about labels without colon
99ASFLAGS += -O9 # Optimize operands to their shortest forms
100
101
102############################################
103# Build process. Actual work is done here. #
104############################################
105
106.PHONY: all at xtplus xt clean
107
108# Make clean debug and release versions
109all: clean at xtplus xt
110 @echo All build!
111
112at:
113 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT) -o"$(TARGET)_at.$(EXTENSION)"
114 @echo AT version "$(TARGET)_at.$(EXTENSION)" build.
115
116xtplus:
117 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS) -o"$(TARGET)_xtp.$(EXTENSION)"
118 @echo XT plus version "$(TARGET)_xtp.$(EXTENSION)" build.
119
120xt:
121 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt.$(EXTENSION)"
122 @echo XT version "$(TARGET)_xt.$(EXTENSION)" build.
123
124clean:
125 @$(RM) $(BUILD_DIR)\*.*
126 @echo Deleted "(*.*)" from "$(BUILD_DIR)/"
Note: See TracBrowser for help on using the repository browser.