source: xtideuniversalbios/trunk/Configurator/makefile@ 125

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

Changes to old configurator:

  • Makefile now uses Nasm (instead of Yasm)
  • Makefile now generates listing files
File size: 3.4 KB
Line 
1###############################################################################
2# Generic makefile for building Assembly 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 = idecfg
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/Libraries/
38HEADERS += Src/Libraries/menu/
39HEADERS += Src/Menupages/
40HEADERS += Src/Menupages/Values/
41
42
43#################################################################
44# Assembler preprocessor defines. #
45#################################################################
46DEFINES =
47
48
49###################
50# Other variables #
51###################
52
53# Add -D in front of every preprocessor define declaration
54DEFS = $(DEFINES:%=-D%)
55
56# Add -I in front of all header directories
57# and also set to search headers from current directory
58IHEADERS = $(HEADERS:%=-I%)
59IHEADERS += -I.
60
61# Path + target file to be build
62TARGET = $(BUILD_DIR)\$(PROG).com
63
64
65#########################
66# Compilers and linkers #
67#########################
68
69# Make
70MAKE = mingw32-make.exe
71
72# Assembler
73AS = nasm.exe
74
75# use this command to erase files.
76RM = -del /Q
77
78
79#############################
80# Compiler and linker flags #
81#############################
82
83# Assembly compiler flags
84ASFLAGS = -f bin # Produce binary object files
85ASFLAGS += $(DEFS) # Preprocessor defines
86ASFLAGS += $(IHEADERS) # Set header file directory paths
87ASFLAGS += -Worphan-labels # Warn about labels without colon
88ASFLAGS += -O9 # Optimize operands to their shortest forms
89
90
91############################################
92# Build process. Actual work is done here. #
93############################################
94
95.PHONY: all clean build
96
97# Make clean debug and release versions
98all:
99 @$(MAKE) clean
100 @$(MAKE) build
101 @echo All build!
102
103# Clean
104clean:
105 @$(RM) $(BUILD_DIR)\*.*
106 @echo Deleted "(*.*)" from "$(BUILD_DIR)\"
107
108# Build
109build:
110 @$(AS) "$(SRC_ASM)" $(ASFLAGS) -l"$(BUILD_DIR)\$(PROG).lst" -o"$(TARGET)"
111 @echo "$(TARGET)" build.
Note: See TracBrowser for help on using the repository browser.