source: xtideuniversalbios/trunk/Configurator/makefile@ 155

Last change on this file since 155 was 145, checked in by krille_n_@…, 14 years ago

Minor size optimizations to all parts of the project (even the old Configurator).
Also added a new 'release' option to the makefiles of both versions of the Configurator. It invokes UPX and makes the Configurator programs ridiculously tiny.

File size: 3.5 KB
RevLine 
[2]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
[145]61# Path + target file to be built
[2]62TARGET = $(BUILD_DIR)\$(PROG).com
63
64
65#########################
66# Compilers and linkers #
67#########################
68
69# Make
70MAKE = mingw32-make.exe
71
72# Assembler
[81]73AS = nasm.exe
[2]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
[145]95.PHONY: all clean build release
[2]96
97# Make clean debug and release versions
98all:
99 @$(MAKE) clean
100 @$(MAKE) build
[145]101 @echo All done!
[2]102
103# Clean
104clean:
105 @$(RM) $(BUILD_DIR)\*.*
106 @echo Deleted "(*.*)" from "$(BUILD_DIR)\"
107
108# Build
109build:
[81]110 @$(AS) "$(SRC_ASM)" $(ASFLAGS) -l"$(BUILD_DIR)\$(PROG).lst" -o"$(TARGET)"
[145]111 @echo "$(TARGET)" built.
112
113release: build
114 @echo Compressing with UPX...
115 @upx -qq --8086 --ultra-brute $(TARGET)
116 @echo Done! $(TARGET) is ready for release.
Note: See TracBrowser for help on using the repository browser.