source: xtideuniversalbios/trunk/BIOS_Drive_Information_Tool/makefile@ 327

Last change on this file since 327 was 327, checked in by aitotat@…, 13 years ago

BIOS Drive Information Tool v1.0.0

File size: 4.0 KB
Line 
1###############################################################################
2# Makefile to build BIOS Drive Information Tool. #
3# #
4# Valid makefile targets are: #
5# all Removes existing files and builds binary file in \Build #
6# clean Removes all files from \Build #
7# #
8# Build directory must be created manually if it does not exist. #
9# #
10###############################################################################
11
12###########################################
13# Source files and destination executable #
14###########################################
15
16# Assembly source code file (*.asm):
17SRC_ASM = Src/Main.asm
18
19# Program executable file name without extension:
20PROG = biosdrvs
21EXTENSION = com
22
23
24#######################################
25# Destination and include directories #
26#######################################
27
28# Directory where binary file will be compiled to
29BUILD_DIR = Build
30
31# Subdirectories where included files are:
32HEADERS = Inc/
33HEADERS += Src/
34
35# Subdirectories where library files are:
36LIBS = ../Assembly_Library/Inc/
37LIBS += ../Assembly_Library/Src/
38LIBS += ../Assembly_Library/Src/Display/
39LIBS += ../Assembly_Library/Src/File/
40LIBS += ../Assembly_Library/Src/Keyboard/
41LIBS += ../Assembly_Library/Src/Menu/
42LIBS += ../Assembly_Library/Src/Menu/Dialog/
43LIBS += ../Assembly_Library/Src/String/
44LIBS += ../Assembly_Library/Src/Time/
45LIBS += ../Assembly_Library/Src/Util/
46LIBS += ../XTIDE_Universal_BIOS/Inc/
47HEADERS += $(LIBS)
48
49
50#################################################################
51# Assembler preprocessor defines. #
52#################################################################
53DEFINES =
54DEFINES_XT = ELIMINATE_CGA_SNOW
55DEFINES_XTPLUS = USE_186 ELIMINATE_CGA_SNOW
56DEFINES_AT = USE_286 USE_AT
57
58
59###################
60# Other variables #
61###################
62
63# Add -D in front of every preprocessor define declaration
64DEFS = $(DEFINES:%=-D%)
65DEFS_XT = $(DEFINES_XT:%=-D%)
66DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%)
67DEFS_AT = $(DEFINES_AT:%=-D%)
68
69# Add -I in front of all header directories
70IHEADERS = $(HEADERS:%=-I%)
71
72# Path + target file to be built
73TARGET = $(BUILD_DIR)/$(PROG)
74
75
76#########################
77# Compilers and linkers #
78#########################
79
80# Make
81MAKE = mingw32-make.exe
82
83# Assembler
84AS = 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 release
107
108all: clean xt
109 @echo All done!
110
111at:
112 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT) -l"$(TARGET)_at.lst" -o"$(TARGET)_at.$(EXTENSION)"
113 @echo AT version "$(TARGET)_at.$(EXTENSION)" built.
114
115xtplus:
116 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XTPLUS) -l"$(TARGET)_xtp.lst" -o"$(TARGET)_xtp.$(EXTENSION)"
117 @echo XT Plus version "$(TARGET)_xtp.$(EXTENSION)" built.
118
119xt:
120 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -l"$(TARGET)_xt.lst" -o"$(TARGET).$(EXTENSION)"
121 @echo XT version "$(TARGET).$(EXTENSION)" built.
122
123clean:
124 @$(RM) $(BUILD_DIR)\*.*
125 @echo Deleted "(*.*)" from "$(BUILD_DIR)/"
126
127release: xt
128 @echo Compressing with UPX...
129 @upx -qq --8086 --ultra-brute $(TARGET).$(EXTENSION)
130 @echo Done! XT version is ready for release.
Note: See TracBrowser for help on using the repository browser.