📄 eval.mak
字号:
#/****************************************************************/
#/* */
#/* ST9+ Software Toolchain V6 Tutorial */
#/* */
#/****************************************************************/
# This makefile is used to build the ST9+ application "compact.u"
#
# This application can then run on any ST9 HDS2V2 hardware emulators.
#
# The different targets are
# compact.u (default target): gmake -f compact.mak compact.u
# or gmake -f compact.mak
# clean: gmake -f compact.mak clean
# rebuild: gmake -f compact.mak rebuild
#
# For more information about the examples, refer to the ST9+ Software
# Toolchain V6 User Manual where they are explained in details.
# This makefile can be easily customized to meet the needs of
# other applications, by modifying the variables hereafter from the line:
# ** BEGINNING OF MODIFIABLE PART **, up to the line:
# *** END OF MODIFIABLE PART ***.
# *******************************************************************
# ***************** BEGINNING OF MODIFIABLE PART *******************
# *******************************************************************
# Definition of a number of variables according to the target
APPLI = eval
MODEL = compact
SCRIPTFILE = eval.ld
# List of source files
#C_SRC = main.c usb.c umass.c mmc.c smartmed.c ecc.c compact.c vMedia.c
#SPP_SRC = lib.spp ecca.spp
C_SRC = main.c usb.c keyboard.c mouse.c joystick.c kbd_desc.c mouse_desc.c joy_desc.c
SPP_SRC =
ASM_SRC =
#List of startup files
STARTUP_SRC = crtbegin.spp crtend.spp
# List of libraries
LIBS =
#List of directories to be searched
VPATH = ../src:../startup
# Location of include files. Do not leave this variable empty.
# If you do not need it, remove or comment it.
INCDIR = ..\include
# Options for compiler
CFLAGS = -m$(MODEL) -I$(INCDIR) -c -g -Wa,-alhd=$*.lis -O
# Options for linker
LDFLAGS = -nostartfiles -T$(SCRIPTFILE) -Wl,-Map,$(APPLI).map
# *******************************************************************
# ***************** END OF MODIFIABLE PART *************************
# *******************************************************************
include $(APPLI).dep
# Name of file containing dependencies.
# This file is automatically generated by this Makefile
DEP = $(APPLI).dep
# The gcc9 driver is used for running the compiler, assembler, linker
GCC = gcc9
# The objcopy9 tool is used for generating the application in intel HEX format
OBJCOPY9 = objcopy9.exe
# List of object files
OBJS = $(patsubst %.spp,%.o,$(filter %.spp,$(STARTUP_SRC))) \
$(patsubst %.asm,%.o,$(filter %.asm,$(ASM_SRC))) \
$(patsubst %.spp,%.o,$(filter %.spp,$(SPP_SRC))) \
$(patsubst %.c,%.o,$(filter %.c,$(C_SRC)))
all: ${APPLI}.u
# Rule for building the target
$(APPLI).u : $(OBJS) $(LIBS) $(SCRIPTFILE)
$(GCC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
$(OBJCOPY9) -Oihex $(APPLI).u $(APPLI).hex
# Rules
%.o:%.c
$(GCC) $(CFLAGS) $< -o $@
%.o:%.asm
$(GCC) $(CFLAGS) $< -o $@
%.o:%.spp
$(GCC) $(CFLAGS) $< -o $@
# Rule for forcing the build without taking into account dependencies
rebuild: clean dependencies $(APPLI).u
# Rule for making dependency file (build)
$(DEP): $(C_SRC) $(SPP_SRC)
@echo Generating dependencies (build)...
$(GCC) -MM -I$(INCDIR) $^ > $@
# Rule for forcing the rebuild of dependency file (rebuild)
.PHONY : dependencies
dependencies : $(C_SRC) $(SPP_SRC)
@echo Generating dependencies (rebuild)...
$(GCC) -MM -I$(INCDIR) $^ > $(DEP)
# Rule for cleaning the application
.PHONY : clean
clean :
@echo off
if exist *.o del *.o
if exist *.u del *.u
if exist *.lis del *.lis
if exist *.map del *.map
if exist *.dep del *.dep
if exist *.hex del *.hex
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -