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