source: xtideuniversalbios/trunk/Configurator/makefile @ 35

Last change on this file since 35 was 9, checked in by aitotat, 14 years ago

Now assembles with Yasm

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
73#AS = nasm.exe
74AS = yasm.exe
75
76# use this command to erase files.
77RM = -del /Q
78
79
80#############################
81# Compiler and linker flags #
82#############################
83
84# Assembly compiler flags
85ASFLAGS = -f bin                # Produce binary object files
86ASFLAGS += $(DEFS)              # Preprocessor defines
87ASFLAGS += $(IHEADERS)          # Set header file directory paths
88ASFLAGS += -Worphan-labels      # Warn about labels without colon
89ASFLAGS += -O9                  # Optimize operands to their shortest forms
90
91
92############################################
93# Build process. Actual work is done here. #
94############################################
95
96.PHONY: all clean build
97
98# Make clean debug and release versions
99all:
100    @$(MAKE) clean
101    @$(MAKE) build
102    @echo All build!
103
104# Clean
105clean:
106    @$(RM) $(BUILD_DIR)\*.*
107    @echo Deleted "(*.*)" from "$(BUILD_DIR)\"
108
109# Build
110build:
111    @$(AS) "$(SRC_ASM)" $(ASFLAGS) -o"$(TARGET)"
112    @echo "$(TARGET)" build.
Note: See TracBrowser for help on using the repository browser.