diff --git a/doc/build.txt b/doc/build.txt new file mode 100644 index 0000000000..757ecf56e6 --- /dev/null +++ b/doc/build.txt @@ -0,0 +1,60 @@ +Design Document for build system + +Build system is using make. + +src/Makefile - this is meta Makefile which has the logic to find the right target under target/ folder and build it by invoke another make. It defines each target as a build target, each family as a build target. In addition to zip_ etc to build zip package for certain target. + Exported Variables: + SDIR = the full path src folder + +src/Makefile.inc - this is core of the build logic. This makefile compose the final build steps and execute them. This file should included as last one in Makefile. + Import Variables: + TARGET = the target name, can be devo10 or emu_devo10 + FAMILY = the family name + EXEEXT = the default exe extention name + + CROSS = set this to prefix of cross-compiler. otherwise leave it as empty + + SRCS_C = the c files to be compiled + SRCS_CPP = the cpp files to be compiled + CFLAGS = the C compile flags + CXXFLAGS = the C++ compile flags + LDFLAGS = the link flags + INCLUDES = the folder to includes + DEFINES = the macro definitions + + MOD_SRCS_C = the c files for module + MOD_CFLAGS = the c compile flags for module + MOD_LDFLAGS = the link flags for modules + + ALL = Additional targets beside $(TARGET).$(EXEEXT) + +src/fs/Makefile.inc - this contains the logic to create filesystem folder for certain target + Import Variables: + TARGET = the target name + FILESYSTEM = the filesystem to be choosed between different predefined sets + FONTS = the fonts to be includes + +src/target///Makefile - this file is entry point for build for target. It normally includes other makefile.inc to compose the build. Normally this file will includes src/target//common/Makefile.inc. + Export Variables: + TARGET = the target name + SRCS = default the files + ODIR = ODIR is defined as $(SDIR)/objs/$(TARGET) + + Import Variables: + SDIR + +src/target//common/Makefile.inc - this contains the logic to abstract common from a Tx family + Import Variables: + TARGET + DTU_PARAM + + Export Variables: + + +src/drivres/mcu//Makefile.inc - this contains the logic for certain platform. For example, stm32 contains the logic for cross-compile and the logic to build libopencm3. x86 contains the logic to build tx on PC platform. + +a typical include chain is like the following + target///Makefile <- target//common/Makefile.inc <- target/drivres/mcu//Makefile.inc + <- target/drivres///Makefile.inc + <- fs/Makefile.inc + <- Makefile.inc diff --git a/src/Makefile b/src/Makefile index 3ebe0b95e0..fca12743f7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,12 +4,13 @@ unexport LANGUAGE MAKEFLAGS += --no-builtin-rules .SUFFIXES: +# Setup common folder structure variables +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +export SDIR = $(dir $(mkfile_path)) + ########################################### ## Provide some convenient make targets ## ########################################### -ifndef TARGET -TARGET ?= devo8 -default: $(TARGET) ALLTARGETS = $(filter-out common,$(notdir $(wildcard target/tx/*/*))) @@ -17,9 +18,15 @@ ALLTARGETS = $(filter-out common,$(notdir $(wildcard target/tx/*/*))) TXS ?= devo6 devo7e devo7e-256 devo8 devo10 devo12e devo12 devof7 devof7-XMS devof4 devof4-XMS devof12e devof12e-XMS at9 at10 t8sg t8sg_v2 t8sg_v2_plus ir8m #Filter non-existant emus -EMUS = $(foreach dir,$(TXS:%=emu_%),$(if $(wildcard target/$(dir)),$(dir),)) -ALLEMUS = $(foreach dir,$(ALLTXS:%=emu_%),$(if $(wildcard target/$(dir)),$(dir),)) +EMUS = $(addprefix emu_, $(TXS)) +ALLEMUS = $(addprefix emu_, $(ALLTXS)) + +default: + @echo specify the target to build. target can be one of + @echo $(TXS) + @echo $(addprefix emu_, $(TXS)) +.PHONY: txs emus both fss zips emuzips winzips release everything txs: $(TXS) emus: $(EMUS) both: txs emus @@ -27,193 +34,46 @@ fss: $(TXS:%=fs_%) zips: $(TXS:%=zip_%) emuzips: $(EMUS:%=zip_%) winzips: $(EMUS:%=zip_win_%) +release: $(TXS:%=zip_%) $(EMUS:%=zip_win_%) $(TXS:%=fs_%) everything: txs emus fss # Generate the targets for a transmitter. define make-target +.PHONY: $1 win_$1 fs_$1 both_$1 zip_$1 zip_win_$1 release_$1 all_$1 $1: - +$(MAKE) TARGET=$1 + +$(MAKE) -f target/tx/$2/$1/Makefile win_$1: ifeq ($(OS),Windows_NT) # This builds Windows emulators on a Windows system - +$(MAKE) TARGET=$1 WINDOWS=1 + +$(MAKE) -C target/tx/$2/$1 WINDOWS=1 else # This builds Windows emulators on a Linux system - +$(MAKE) TARGET=$1 WINDOWS=1 CROSS=i586-mingw32msvc- + +$(MAKE) -C target/tx/$2/$1 WINDOWS=1 CROSS=i586-mingw32msvc- endif fs_$1: ifneq "$(INCLUDE_FS)" "1" - +$(MAKE) TARGET=$1 fs + +$(MAKE) -C target/tx/$2/$1 fs endif both_$1: $1 emu_$1 zip_$1: - +$(MAKE) TARGET=$1 zip + +$(MAKE) -C target/tx/$2/$1 zip zip_win_$1: ifeq ($(OS),Windows_NT) # This builds Windows emulators on a Windows system - +$(MAKE) TARGET=$1 WINDOWS=1 zip + +$(MAKE) -C target/tx/$2/$1 WINDOWS=1 zip else # This builds Windows emulators on a Linux system - +$(MAKE) TARGET=$1 WINDOWS=1 CROSS=i586-mingw32msvc- zip + +$(MAKE) -C target/tx/$2/$1 WINDOWS=1 CROSS=i586-mingw32msvc- zip endif release_$1: zip_$1 zip_win_emu_$1 fs_$1 all_$1: - +$(MAKE) TARGET=$1 all + +$(MAKE) -C target/tx/$2/$1 all endef # Now generate all the convenience targets -$(foreach t,$(ALLTARGETS),$(eval $(call make-target,$t))) -endif - -# Determine the directory above the target directory -FAMILY = $(notdir $(patsubst %/,%,$(dir $(wildcard target/tx/*/$(TARGET))))) - -# We want to turn on INCLUDE_FS by default -INCLUDE_FS ?= 1 - -# Use VERBOSE=1 to enable verbose make -PROGMODE ?= STATUS_SCREEN -SDIR := . -include target/tx/$(FAMILY)/$(TARGET)/Makefile.inc - -NUM_MODELS ?= 30 -TYPE ?= prd - -############################################### -#This section defines binaries needed to build# -############################################### -ifdef CROSS - CC = $(CROSS)gcc - CXX = $(CROSS)g++ - LD = $(CROSS)ld - AR = $(CROSS)ar - AS = $(CROSS)as - CP = $(CROSS)objcopy - DUMP = $(CROSS)objdump - NM = $(CROSS)nm -endif -CC ?= gcc -CXX ?= g++ -LD ?= ld -AR ?= ar -AS ?= as -CP ?= objcopy -DUMP ?= objdump -############################################### -#END SECTION # -############################################### - -############################################ -#This section defines the source files used# -############################################ -SRC_C += $(wildcard *.c) $(wildcard misc/*.c) $(wildcard screen/*.c) $(wildcard screen/$(SCREENSIZE)/*.c) \ - $(wildcard gui/*.c) $(wildcard pages/$(SCREENSIZE)/*.c) $(wildcard config/*.c) - -ifdef MODULAR - SRC_C += protocol/protocol.c - PROTO_SRC_C := $(filter-out protocol/protocol.c, $(wildcard protocol/*.c) $(wildcard protocol/spi/*.c)) -else - SRC_C := $(SRC_C) $(wildcard protocol/*.c) $(wildcard protocol/spi/*.c) -endif - -SRC_C := $(SRC_C) $(wildcard pages/$(SCREENSIZE)/standard/*.c) -SRC_C := $(SRC_C) $(wildcard pages/$(SCREENSIZE)/advanced/*.c) - -SRC_S := $(SRC_S) $(wildcard *.s) -SRC_CXX := $(SRC_CXX) $(wildcard *.cpp) -SRCS := $(SRC_C) $(SRC_CXX) $(SRC_S) -############################################ -#END SECTION # -############################################ - - -############################################ -#This section intermediate build files # -############################################ -ODIR = objs/$(TARGET)$(ODIREXT) -OBJS = $(addprefix $(ODIR)/, $(notdir $(SRC_C:.c=.o) $(SRC_S:.s=.o) $(SRC_CXX:.cpp=.o))) - -ifdef MODULAR -PROTO_OBJS := $(addprefix $(ODIR)/, $(notdir $(PROTO_SRC_C:.c=.o))) -PROTO_LIBS := $(addprefix $(ODIR)/, $(notdir $(PROTO_SRC_C:.c=.bin))) -PROTO_EXTRA_OBJS := $(addprefix $(ODIR)/, $(notdir $(PROTO_EXTRA_C:.c=.o_))) -SYMBOL_FILE := $(ODIR)/symbolfile -endif - -HGVERSION ?= $(shell ../utils/get_version.pl ${TARGET}) -HGVERSION := $(HGVERSION) - -# Rebuild on hg version change. -# Based on http://mercurial.selenic.com/wiki/VersioningWithMake -# We need to always run this code, as opposed to running it from a prerequisite -# The HGTEST variable is not used -HGTEST := $(shell mkdir -p $(ODIR); \ - [ -f $(ODIR)/hgstamp ] || touch $(ODIR)/hgstamp; \ - echo $(HGVERSION) | cmp -s $(ODIR)/hgstamp - \ - || echo $(HGVERSION) > $(ODIR)/hgstamp) -############################################ -#END SECTION # -############################################ - -################################################## -#This section contains switches used for building# -################################################## -ifeq "$(TYPE)" "dev" - CFLAGS := $(CFLAGS) -DBUILDTYPE_DEV -endif -ifdef MODULAR -MODULE_CFLAGS := $(MODULE_CFLAGS) -DMODULAR=$(MODULAR) -CFLAGS := $(CFLAGS) -DENABLE_MODULAR=$(MODULAR) -endif - -CFLAGS := $(CFLAGS) -g -Wall -Wextra -Werror=undef -I. -D$(PROGMODE) -std=gnu99 -Itarget/tx/$(FAMILY)/$(TARGET) -Igui/$(SCREENSIZE) \ - -Ipages/$(SCREENSIZE) \ - -DHGVERSION="\"${HGVERSION}\"" -CXXFLAGS := $(CXXFLAGS) $(patsubst -std=gnu99,,$(CFLAGS)) -EXEEXT ?= elf -################################################## -#END SECTION # -################################################## - -############################################ -#this section defines final build files # -############################################ -FILESYSTEM = $(subst emu_,,$(TARGET)) -MODELDIR = filesystem/$(FILESYSTEM)/models - -LAST_MODEL := $(MODELDIR)/model$(NUM_MODELS).ini - -ALL += $(TARGET).fs_wrapper -ifdef MODULAR -include protocol/Makefile.inc -endif -############################################ -#END SECTION # -############################################ - -############################################ -#this section includes build targets # -############################################ -all : $(ALL) - -#################################### -# recompile if the Makefile changes# -#################################### -$(OBJS) $(PROTO_OBJS) ($PROTO_EXTRA_OBJS): Makefile target/tx/$(FAMILY)/$(TARGET)/Makefile.inc $(EXTRA_MAKEFILES) - -################################################################################## -# The following enables quiet output unless you use VERBOSE=1 # -# Note that this must be after the 1st rule so that it doesn't execute by default# -################################################################################## -$(VERBOSE).SILENT: - -.PHONY: clean distclean language lint - -clean: - rm -f $(TARGET).$(EXEEXT) $(TARGET).exe $(TARGET).bin $(TARGET).dfu $(TARGET).list \ - $(TARGET).map $(ODIR)/*.o $(ODIR)/*.o_ $(ODIR)/*.P $(ODIR)/*.bin \ - filesystem/$(FILESYSYTEM) 2> /dev/null || true +$(foreach t,$(ALLTARGETS),$(eval $(call make-target,$t,$(notdir $(patsubst %/,%,$(dir $(wildcard target/tx/*/$(t)))))))) +.PHONY: distclean coverity lint distclean: rm -f *.$(EXEEXT) *.exe *.bin *.dfu *.list *.map rm -rf objs @@ -221,191 +81,11 @@ distclean: $(MAKE) -C libopencm3 clean > /dev/null rm -rf deviation*.zip -language: - ../utils/extract_strings.pl -po > fs/language/deviation.po - - -zip: $(TARGET).zip - -%.zip: $(ALL) $(TARGET).dfu $(PROTO_MODULES) - #This is not an emulator build (emulator is hanled in target/common/emu/Makefile.inc) - cp -f $(TARGET).dfu deviation-$(HGVERSION).dfu - rm -f deviation-$(HGVERSION).zip - rm -f debug-$(HGVERSION).zip - zip debug-$(HGVERSION).zip $(TARGET).elf - # $(MAKE) zipping more compatible with other distributions - export p=`pwd`; cd $(ODIR) && test -e devo.fs && zip -u $$p/deviation-$(HGVERSION).zip devo.fs && rm devo.fs || true - zip deviation-$(HGVERSION).zip deviation-$(HGVERSION).dfu UPDATING.md -ifdef MODULAR - export p=`pwd`; cd $(ODIR) && zip -ur $$p/deviation-$(HGVERSION).zip protocol/*.mod - export p=`pwd`; cd $(ODIR) && zip -u $$p/debug-$(HGVERSION).zip *.elf - rm -rf $(ODIR)/protocol -endif -ifeq "$(INCLUDE_FS)" "1" - export p=`pwd`; cd filesystem/$(FILESYSTEM) && zip -ur $$p/deviation-$(HGVERSION).zip * -endif - zip -u deviation-$(HGVERSION).zip debug-$(HGVERSION).zip - rm -f debug-$(HGVERSION).zip - rm -f deviation-$(HGVERSION).dfu - -fs: $(TARGET).fs - -%.fs: - rm -f deviation-fs-$(HGVERSION).zip; zip -r deviation-fs-$(HGVERSION).zip filesystem/$(FILESYSTEM) - -release: $(TXS:%=zip_%) $(EMUS:%=zip_win_%) $(TXS:%=fs_%) - coverity: rm -rf cov-int 2>/dev/null; $(MAKE) distclean - cov-build --dir cov-int make TARGET=devo8 - cov-build --dir cov-int make TARGET=devo10 + cov-build --dir cov-int make -C target/tx/devo/devo8 + cov-build --dir cov-int make -C target/tx/devo/devo10 tar -cvzf coverity-$(HGVERSION).tgz cov-int lint: ../utils/run_linter.py --diff --debug - -########################################## -#Ensure necessary directories are created# -########################################## -$(OBJS): | $(ODIR) - -$(ODIR): - @mkdir -p $@ - -$(MODELDIR): - @mkdir -p $@ - -###################### -#The main executable # -###################### -$(TARGET).$(EXEEXT): $(LINKFILE) $(OBJS) $(LIBOPENCM3) - @echo " + Building '$@'" -ifdef LINKFILE #Create an empty 'obj/$(TARGET)/optimize.ld' just in case the linker script needs it - echo "" > objs/$(TARGET)/optimize.ld -endif -ifeq ("$(SRC_CXX)", " ") - $(CC) -o $@ $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(LFLAGS2) $(CFLAGS) $(EXTRA_CFLAGS) -else - $(CXX) -o $@ $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(LFLAGS2) $(CFLAGS) $(EXTRA_CFLAGS) -endif - -################# -#The filesystem # -################# -%.fs_wrapper: $(LAST_MODEL) - true - -.PHONY: $(PRE_FS) $(LAST_MODEL) -$(LAST_MODEL): model_template.ini tx_template.ini $(FONTS) $(PRE_FS) - @echo " + Copying template files for $(FILESYSTEM)" - mkdir -p filesystem/$(FILESYSTEM) || true - for i in $(FILESYSTEMS); do cp -prf fs/$$i/* filesystem/$(FILESYSTEM)/; done - rm filesystem/$(FILESYSTEM)/*/.ignore 2>/dev/null || true - cp tx_template.ini filesystem/$(FILESYSTEM)/tx.ini - echo 'empty' > filesystem/$(FILESYSTEM)/errors.txt - mkdir filesystem/$(FILESYSTEM)/models 2> /dev/null || true - echo 'name=Model1' > filesystem/$(FILESYSTEM)/models/model1.ini \ - && cat model_template.ini >> filesystem/$(FILESYSTEM)/models/model1.ini - cp model_template.ini filesystem/$(FILESYSTEM)/models/default.ini -ifdef LANGUAGE - mkdir filesystem/$(FILESYSTEM)/language 2> /dev/null; \ - ../utils/extract_strings.pl -po -fs filesystem/$(FILESYSTEM)/language -targets $(LANGUAGE) -update -objdir $(ODIR) -endif - export tx=$(FILESYSTEM); \ - number=2 ; while [ $$number -le $(NUM_MODELS) ] ; do \ - cp model_template.ini filesystem/$$tx/models/model$$number.ini; \ - number=`expr $$number + 1`; \ - done - @echo " + Checking string list length for $(FILESYSTEM)" -ifeq "$(TYPE)" "dev" - ../utils/check_string_size.pl -target $(FILESYSTEM) -objdir $(ODIR) -else - ../utils/check_string_size.pl -target $(FILESYSTEM) -objdir $(ODIR) -quiet -endif - ../utils/run_linter.py --diff --skip-github --no-fail - -###################### -#Necessary Font files# -###################### -filesystem/$(FILESYSTEM)/media/12normal.fon: fonts/12normal.bdf - mkdir -p filesystem/$(FILESYSTEM)/media/ - ../utils/font/bdf_to_font.pl -maxsize 12 -mode bin $< -out $@ -minspace 10 - -filesystem/$(FILESYSTEM)/media/15normal.fon: fonts/15normal.bdf - mkdir -p filesystem/$(FILESYSTEM)/media/ - ../utils/font/bdf_to_font.pl -maxsize 15 -mode bin $< -out $@ -minspace 8 - -# special font for f12e with 18x12 char size -filesystem/$(FILESYSTEM)/media/f12e.fon: fonts/f12e.bdf - mkdir -p filesystem/$(FILESYSTEM)/media/ - ../utils/font/bdf_to_font.pl -maxsize 18 -mode bin $< -out $@ -minspace 8 - -filesystem/$(FILESYSTEM)/media/12ascii.fon: fonts/12normal.bdf - mkdir -p filesystem/$(FILESYSTEM)/media/ - ../utils/font/bdf_to_font.pl -maxsize 12 -mode bin $< -out $@ -minspace 10 -ascii - -filesystem/$(FILESYSTEM)/media/15ascii.fon: fonts/15normal.bdf - mkdir -p filesystem/$(FILESYSTEM)/media/ - ../utils/font/bdf_to_font.pl -maxsize 15 -mode bin $< -out $@ -minspace 8 -ascii - -filesystem/$(FILESYSTEM)/media/23bold.fon: fonts/23bold.bdf - mkdir -p filesystem/$(FILESYSTEM)/media/ - ../utils/font/bdf_to_font.pl -maxsize 23 -mode bin $< -out $@ -minspace 8 - -filesystem/$(FILESYSTEM)/media/04b03.fon: fonts/04b03.bdf - mkdir -p filesystem/$(FILESYSTEM)/media/ - ../utils/font/bdf_to_font.pl -maxsize 5 -mode bin $< -out $@ -minspace 5 - -############################## -#Build rules for all .o files# -############################## -## The autodependency magic below was adapeted from: -## http://mad-scientist.net/make/autodep.html --include $(OBJS:.o=.P) --include $(PROTO_OBJS:.o=.P) --include $(PROTO_EXTRA_OBJS:.o_=.P) - -dollar = $$ -define define_compile_rules -$(ODIR)/%.o: $(1)%.c $(LIBOPENCM3) - @echo " + Compiling '$$<'" - $(CC) $$(CFLAGS) $$(EXTRA_CFLAGS) $$(CFLAGS_$$(basename $$(notdir $$<))) -MD -c -o $$@ $$< - @cp $(ODIR)/$$*.d $(ODIR)/$$*.P; \ - sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$(dollar)//' \ - -e '/^$$(dollar)/ d' -e 's/$$(dollar)/ :/' < $(ODIR)/$$*.d >> $(ODIR)/$$*.P; \ - rm -f $(ODIR)/$$*.d - -$(ODIR)/%.o: $(1)%.cpp $(LIBOPENCM3) - @echo " + Compiling '$$<'" - $(CXX) $$(CXXFLAGS) $(EXTRA_CFLAGS) $$(CXXFLAGS_$$(basename $$(notdir $$<))) -MD -c -o $$@ $$< - @cp $(ODIR)/$$*.d $(ODIR)/$$*.P; \ - sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$(dollar)//' \ - -e '/^$$(dollar)/ d' -e 's/$$(dollar)/ :/' < $(ODIR)/$$*.d >> $(ODIR)/$$*.P; \ - rm -f $(ODIR)/$$*.d - -#For module building -$(ODIR)/%.o_: $(1)%.c $(LIBOPENCM3) - @echo " + Compiling '$$<' as module" - $(CC) $$(CFLAGS) $$(MODULE_CFLAGS) $$(CFLAGS_$$(basename $$(notdir $$<))) -MD -c -o $$@ $$< - @cp $(ODIR)/$$*.d $(ODIR)/$$*.P; \ - sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$(dollar)//' \ - -e '/^$$(dollar)/ d' -e 's/$$(dollar)/ :/' < $(ODIR)/$$*.d >> $(ODIR)/$$*.P; \ - rm -f $(ODIR)/$$*.d - -endef -$(foreach directory,$(sort $(dir $(SRCS) $(PROTO_EXTRA_C))),$(eval $(call define_compile_rules,$(directory)))) - -############################## -#Ensure version is up to date# -############################## -# Rebuild on hg version change. -$(ODIR)/version.o: $(ODIR)/hgstamp - -$(ODIR)/hgstamp: - echo $(HGVERSION) > $(ODIR)/hgstamp - -BUILD_TARGET := 1 -include target/tx/$(FAMILY)/$(TARGET)/Makefile.inc -ifdef MODULAR -include protocol/Makefile.inc -endif diff --git a/src/Makefile.inc b/src/Makefile.inc new file mode 100644 index 0000000000..31bdd98114 --- /dev/null +++ b/src/Makefile.inc @@ -0,0 +1,247 @@ +# +# This inc file have to be included as last include in the makefile include chain. +# Some import variables: +# DRIVERS - list out the drivres which need be added. +# SCREENSIZE - define the screen size (type) +# CROSS - define if need a different compiler than default +# CFLAGS - define the compiler options for firmware +# LDFLAGS - define the linker options +# SRCS_C - C source files in the full path +# SRCS_CPP - cpp source files in the full path + +# We want to turn on INCLUDE_FS by default +INCLUDE_FS ?= 1 + +NUM_MODELS ?= 30 +TYPE ?= prd + +############################################### +#This section defines binaries needed to build# +############################################### +ifdef CROSS + CC = $(CROSS)gcc + CXX = $(CROSS)g++ + LD = $(CROSS)ld + AR = $(CROSS)ar + AS = $(CROSS)as + CP = $(CROSS)objcopy + DUMP = $(CROSS)objdump + NM = $(CROSS)nm +endif +CC ?= gcc +CXX ?= g++ +LD ?= ld +AR ?= ar +AS ?= as +CP ?= objcopy +DUMP ?= objdump +############################################### +#END SECTION # +############################################### + +############################################ +#This section defines the source files used# +############################################ +#ifndef SCREENSIZE +#error please define SCREENSIZE +#endif + +SRC_C += $(wildcard $(SDIR)*.c) \ + $(wildcard $(SDIR)misc/*.c) \ + $(wildcard $(SDIR)screen/*.c) \ + $(wildcard $(SDIR)screen/$(SCREENSIZE)/*.c) \ + $(wildcard $(SDIR)gui/*.c) \ + $(wildcard $(SDIR)pages/$(SCREENSIZE)/*.c) \ + $(wildcard $(SDIR)config/*.c) + +ifdef MODULAR + SRC_C += $(SDIR)protocol/protocol.c + PROTO_SRC_C := $(filter-out $(SDIR)protocol/protocol.c, $(wildcard $(SDIR)protocol/*.c) $(wildcard $(SDIR)protocol/spi/*.c)) +else + SRC_C += $(wildcard $(SDIR)protocol/*.c) $(wildcard $(SDIR)protocol/spi/*.c) +endif + +SRC_C += $(wildcard $(SDIR)pages/$(SCREENSIZE)/standard/*.c) +SRC_C += $(wildcard $(SDIR)pages/$(SCREENSIZE)/advanced/*.c) + +SRC_S += $(wildcard *.s) +SRC_CXX += $(wildcard *.cpp) +SRCS := $(SRC_C) $(SRC_CXX) $(SRC_S) +############################################ +#END SECTION # +############################################ + + +############################################ +#This section intermediate build files # +############################################ +ODIR = $(SDIR)objs/$(TARGET)$(ODIREXT)/ +OBJS := $(patsubst %.c,$(ODIR)%.o,$(notdir $(SRC_C))) $(patsubst %.cpp,$(ODIR)%.o,$(notdir $(SRC_CXX))) + +ifdef MODULAR +PROTO_OBJS := $(addprefix $(ODIR), $(notdir $(PROTO_SRC_C:.c=.o))) +PROTO_LIBS := $(addprefix $(ODIR), $(notdir $(PROTO_SRC_C:.c=.bin))) +PROTO_EXTRA_OBJS := $(addprefix $(ODIR), $(notdir $(PROTO_EXTRA_C:.c=.o_))) +SYMBOL_FILE := $(ODIR)symbolfile +endif + +VPATH = $(dir $(SRCS)) +HGVERSION ?= $(shell $(SDIR)../utils/get_version.pl ${TARGET}) +HGVERSION := $(HGVERSION) + +# Rebuild on hg version change. +# Based on http://mercurial.selenic.com/wiki/VersioningWithMake +# We need to always run this code, as opposed to running it from a prerequisite +# The HGTEST variable is not used +HGTEST := $(shell mkdir -p $(ODIR); \ + [ -f $(ODIR)hgstamp ] || touch $(ODIR)hgstamp; \ + echo $(HGVERSION) | cmp -s $(ODIR)hgstamp - \ + || echo $(HGVERSION) > $(ODIR)hgstamp) +############################################ +#END SECTION # +############################################ + +################################################## +#This section contains switches used for building# +################################################## +ifeq "$(TYPE)" "dev" + CFLAGS := $(CFLAGS) -DBUILDTYPE_DEV +endif +ifdef MODULAR +MODULE_CFLAGS := -DMODULAR=$(MODULAR) +CFLAGS += -DENABLE_MODULAR=$(MODULAR) +endif + +CFLAGS := $(CFLAGS) -g -Wall -Wextra -Werror=undef -I$(SDIR) -std=gnu99 \ + -I$(SDIR)target/tx/$(FAMILY)/$(TARGET) -I$(SDIR)gui/$(SCREENSIZE) \ + -I$(SDIR)pages/$(SCREENSIZE) \ + -DHGVERSION="\"${HGVERSION}\"" +CXXFLAGS := $(CXXFLAGS) $(patsubst -std=gnu99,,$(CFLAGS)) +EXEEXT ?= elf +################################################## +#END SECTION # +################################################## + +############################################ +#this section defines final build files # +############################################ +FILESYSTEM = $(subst emu_,,$(TARGET)) +FS_ROOT = $(SDIR)filesystem/$(FILESYSTEM) +MODELDIR = $(FS_ROOT)/models + +LAST_MODEL := $(MODELDIR)/model$(NUM_MODELS).ini + +ALL += $(ODIR) $(TARGET).fs_wrapper $(OBJS) + +############################################ +#END SECTION # +############################################ + +############################################ +#this section includes build targets # +############################################ +.PHONY: all +all : $(ALL) + +#################################### +# recompile if the Makefile changes# +#################################### +#$(OBJS) $(PROTO_OBJS) ($PROTO_EXTRA_OBJS): Makefile target/tx/$(FAMILY)/$(TARGET)/Makefile.inc $(EXTRA_MAKEFILES) + +################################################################################## +# The following enables quiet output unless you use VERBOSE=1 # +# Note that this must be after the 1st rule so that it doesn't execute by default# +################################################################################## +$(VERBOSE).SILENT: + +.PHONY: clean language lint + +clean: + rm -f $(TARGET).$(EXEEXT) $(TARGET).exe $(TARGET).bin $(TARGET).dfu $(TARGET).list \ + $(TARGET).map $(ODIR)*.o $(ODIR)*.o_ $(ODIR)*.P $(ODIR)*.bin \ + $(FS_ROOT) 2> /dev/null || true + +language: + ../utils/extract_strings.pl -po > fs/language/deviation.po + +zip: $(TARGET).zip + +%.zip: $(ALL) $(PROTO_MODULES) + #This is not an emulator build (emulator is hanled in target/common/emu/Makefile.inc) + cp -f $(TARGET).dfu deviation-$(HGVERSION).dfu + rm -f deviation-$(HGVERSION).zip + rm -f debug-$(HGVERSION).zip + zip debug-$(HGVERSION).zip $(TARGET).elf + # $(MAKE) zipping more compatible with other distributions + export p=`pwd`; cd $(ODIR) && test -e devo.fs && zip -u $$p/deviation-$(HGVERSION).zip devo.fs && rm devo.fs || true + zip deviation-$(HGVERSION).zip deviation-$(HGVERSION).dfu UPDATING.md +ifdef MODULAR + export p=`pwd`; cd $(ODIR) && zip -ur $$p/deviation-$(HGVERSION).zip protocol/*.mod + export p=`pwd`; cd $(ODIR) && zip -u $$p/debug-$(HGVERSION).zip *.elf + rm -rf $(ODIR)protocol +endif +ifeq "$(INCLUDE_FS)" "1" + export p=`pwd`; cd $(FS_ROOT) && zip -ur $$p/deviation-$(HGVERSION).zip * +endif + zip -u deviation-$(HGVERSION).zip debug-$(HGVERSION).zip + rm -f debug-$(HGVERSION).zip + rm -f deviation-$(HGVERSION).dfu + +fs: $(TARGET).fs + +%.fs: + rm -f deviation-fs-$(HGVERSION).zip; zip -r deviation-fs-$(HGVERSION).zip $(FS_ROOT) + + +########################################## +#Ensure necessary directories are created# +########################################## +$(OBJS): | $(ODIR) + +$(ODIR): + @mkdir -p $@ + +$(MODELDIR): + @mkdir -p $@ + +###################### +#The main executable # +###################### +$(SDIR)$(TARGET).$(EXEEXT): $(LINKFILE) $(OBJS) $(LIBOPENCM3) + @echo " + Building '$(notdir $@)'" +ifdef LINKFILE #Create an empty 'obj/$(TARGET)/optimize.ld' just in case the linker script needs it + echo "" > $(ODIR)optimize.ld +endif +ifeq ("$(SRC_CXX)", "") + $(CC) -o $@ $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(LFLAGS2) $(CFLAGS) $(EXTRA_CFLAGS) +else + $(CXX) -o $@ $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(LFLAGS2) $(CFLAGS) $(EXTRA_CFLAGS) +endif + +############################## +#Build rules for all .o files# +############################## +$(ODIR)%.o: %.c + @echo " + Compiling '$(notdir $<)'" + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basename $(notdir $<))) -MT $@ -MD -MP -MF $(@:.o=.d) -c -o $@ $< + +$(ODIR)%.o: %.cpp + @echo " + Compiling '$(notdir $<)'" + $(CXX) $(CXXFLAGS) $(EXTRA_CFLAGS) $(CXXFLAGS_$(basename $(notdir $<))) -MD -MP -MF $(@:.o=.d) -c -o $@ $< + +#For module building +$(ODIR)%.o_: %.c + @echo " + Compiling '$(notdir $<)' as module" + $(CC) $(CFLAGS) $(MODULE_CFLAGS) $(CFLAGS_$(basename $(notdir $<))) -c -o $@ $< + +############################## +#Ensure version is up to date# +############################## +# Rebuild on hg version change. +$(ODIR)version.o: $(ODIR)hgstamp + +$(ODIR)hgstamp: + echo $(HGVERSION) > $(ODIR)hgstamp + +include $(SDIR)fs/Makefile.inc +-include $(OBJS:.o=.d) diff --git a/src/config/voice.c b/src/config/voice.c index 4371bc45bf..8f80dfd52b 100644 --- a/src/config/voice.c +++ b/src/config/voice.c @@ -17,7 +17,7 @@ #include #include "common.h" #include "model.h" -#include "../music.h" +#include "music.h" #include "extended_audio.h" #include "tx.h" #include "voice.h" diff --git a/src/fs/Makefile.inc b/src/fs/Makefile.inc new file mode 100644 index 0000000000..eda5e4c910 --- /dev/null +++ b/src/fs/Makefile.inc @@ -0,0 +1,67 @@ +################# +#The filesystem # +################# + +%.fs_wrapper: $(LAST_MODEL) + true + +.PHONY: $(PRE_FS) $(LAST_MODEL) +$(LAST_MODEL): $(SDIR)/model_template.ini $(SDIR)/tx_template.ini $(FONTS) $(PRE_FS) + @echo " + Copying template files for $(FILESYSTEM)" + mkdir -p $(FS_ROOT) || true + for i in $(FILESYSTEMS); do cp -prf $(SDIR)/fs/$$i/* $(FS_ROOT)/; done + rm $(FS_ROOT)/*/.ignore 2>/dev/null || true + cp $(SDIR)/tx_template.ini $(FS_ROOT)/tx.ini + echo 'empty' > $(FS_ROOT)/errors.txt + mkdir $(FS_ROOT)/models 2> /dev/null || true + echo 'name=Model1' > $(FS_ROOT)/models/model1.ini \ + && cat $(SDIR)/model_template.ini >> $(FS_ROOT)/models/model1.ini + cp $(SDIR)/model_template.ini $(FS_ROOT)/models/default.ini +ifdef LANGUAGE + mkdir $(FS_ROOT)/language 2> /dev/null; \ + $(SDIR)/../utils/extract_strings.pl -po -fs $(FS_ROOT)/language -targets $(LANGUAGE) -update -objdir $(ODIR) +endif + export tx=$(FILESYSTEM); \ + number=2 ; while [ $$number -le $(NUM_MODELS) ] ; do \ + cp $(SDIR)/model_template.ini filesystem/$$tx/models/model$$number.ini; \ + number=`expr $$number + 1`; \ + done + @echo " + Checking string list length for $(FILESYSTEM)" +ifeq "$(TYPE)" "dev" + $(SDIR)/../utils/check_string_size.pl -target $(FILESYSTEM) -objdir $(ODIR) +else + $(SDIR)/../utils/check_string_size.pl -target $(FILESYSTEM) -objdir $(ODIR) -quiet +endif + $(SDIR)/../utils/run_linter.py --diff --skip-github --no-fail + +###################### +#Necessary Font files# +###################### +$(FS_ROOT)/media/12normal.fon: $(SDIR)/fonts/12normal.bdf + mkdir -p $(FS_ROOT)/media/ + $(SDIR)/../utils/font/bdf_to_font.pl -maxsize 12 -mode bin $< -out $@ -minspace 10 + +$(FS_ROOT)/media/15normal.fon: $(SDIR)/fonts/15normal.bdf + mkdir -p $(FS_ROOT)/media/ + $(SDIR)/../utils/font/bdf_to_font.pl -maxsize 15 -mode bin $< -out $@ -minspace 8 + +# special font for f12e with 18x12 char size +$(FS_ROOT)/media/f12e.fon: $(SDIR)/fonts/f12e.bdf + mkdir -p $(FS_ROOT)/media/ + $(SDIR)/../utils/font/bdf_to_font.pl -maxsize 18 -mode bin $< -out $@ -minspace 8 + +$(FS_ROOT)/media/12ascii.fon: $(SDIR)/fonts/12normal.bdf + mkdir -p $(FS_ROOT)/media/ + $(SDIR)/../utils/font/bdf_to_font.pl -maxsize 12 -mode bin $< -out $@ -minspace 10 -ascii + +$(FS_ROOT)/media/15ascii.fon: $(SDIR)/fonts/15normal.bdf + mkdir -p $(FS_ROOT)/media/ + $(SDIR)/../utils/font/bdf_to_font.pl -maxsize 15 -mode bin $< -out $@ -minspace 8 -ascii + +$(FS_ROOT)/media/23bold.fon: $(SDIR)/fonts/23bold.bdf + mkdir -p $(FS_ROOT)/media/ + $(SDIR)/../utils/font/bdf_to_font.pl -maxsize 23 -mode bin $< -out $@ -minspace 8 + +$(FS_ROOT)/media/04b03.fon: $(SDIR)/fonts/04b03.bdf + mkdir -p $(FS_ROOT)/media/ + $(SDIR)/../utils/font/bdf_to_font.pl -maxsize 5 -mode bin $< -out $@ -minspace 5 diff --git a/src/protocol/Makefile.inc b/src/protocol/Makefile.inc index 3e85247b1d..79c6c72f24 100644 --- a/src/protocol/Makefile.inc +++ b/src/protocol/Makefile.inc @@ -1,5 +1,3 @@ -ifndef BUILD_TARGET - PROTO_MODULES += $(ODIR)/protocol/devo.mod PROTO_MODULES += $(ODIR)/protocol/dsm2.mod PROTO_MODULES += $(ODIR)/protocol/dsmx.mod diff --git a/src/target/drivers/mcu/emu/Makefile.inc b/src/target/drivers/mcu/emu/Makefile.inc index 5973470cd9..f5b5c3e779 100644 --- a/src/target/drivers/mcu/emu/Makefile.inc +++ b/src/target/drivers/mcu/emu/Makefile.inc @@ -1,28 +1,29 @@ -ifndef BUILD_TARGET +ifneq ("$(TARGET)", "test") +SRC_CXX = $(wildcard $(SDIR)target/tx/$(FAMILY)/$(TARGET)/*.cpp) \ + $(wildcard $(SDIR)target/drivers/mcu/emu/*.cpp) +endif -SRC_CXX = $(wildcard target/tx/$(FAMILY)/$(TARGET)/*.cpp) \ - $(wildcard target/drivers/mcu/emu/*.cpp) -SRC_C = $(wildcard target/tx/$(FAMILY)/$(TARGET)/*.c) \ - $(wildcard target/drivers/mcu/emu/*.c) \ - $(wildcard $(SDIR)/target/drivers/filesystems/*.c) +SRC_C = $(wildcard $(SDIR)target/tx/$(FAMILY)/$(TARGET)/*.c) \ + $(wildcard $(SDIR)target/drivers/mcu/emu/*.c) \ + $(wildcard $(SDIR)target/drivers/filesystems/*.c) ifeq ("$(SCREENSIZE)", "128x64x1") -SRC_C += $(SDIR)/target/drivers/display/emu/emu_monochrome.c +SRC_C += $(SDIR)target/drivers/display/emu/emu_monochrome.c else ifneq ("$(SCREENSIZE)", "text") -SRC_C += $(SDIR)/target/drivers/display/emu/emu_color.c +SRC_C += $(SDIR)target/drivers/display/emu/emu_color.c endif ifdef USE_INTERNAL_FS -SRC_C += $(wildcard $(SDIR)/target/drivers/filesystems/devofs/*.c) \ - $(wildcard $(SDIR)/target/drivers/filesystems/petit_fat/*.c) -CFLAGS = -DEMULATOR=USE_INTERNAL_FS +SRC_C += $(wildcard $(SDIR)target/drivers/filesystems/devofs/*.c) \ + $(wildcard $(SDIR)target/drivers/filesystems/petit_fat/*.c) +CFLAGS += -DEMULATOR=USE_INTERNAL_FS else -CFLAGS = -DEMULATOR=USE_NATIVE_FS +CFLAGS += -DEMULATOR=USE_NATIVE_FS endif -CFLAGS += -Itarget/drivers/mcu/emu -I$(SDIR)/target/drivers/filesystems +CFLAGS += -I$(SDIR)target/drivers/mcu/emu -I$(SDIR)target/drivers/filesystems -ALL = $(TARGET).$(EXEEXT) +ALL += $(SDIR)$(TARGET).$(EXEEXT) TYPE ?= dev @@ -44,6 +45,7 @@ ifdef WINDOWS EXEEXT = exe ODIREXT = -w32 else + EXEEXT = elf CFLAGS := $(CFLAGS) $(shell fltk-config --cflags) LFLAGS := $(LFLAGS) $(shell fltk-config --ldflags) ifndef SOUND @@ -52,7 +54,9 @@ else LFLAGS := $(LFLAGS) -lportaudio endif endif -else #BUILD_TARGET + +default: $(SDIR)$(TARGET).$(EXEEXT) + CFLAGS += -DFILESYSTEM_DIR="\"filesystem/$(FILESYSTEM)\"" $(TARGET).zip: $(TARGET).$(EXEEXT) $(TARGET).fs_wrapper @@ -66,5 +70,3 @@ ifeq "$(INCLUDE_FS)" "1" zip -ur deviation-$(HGVERSION).zip filesystem/$(FILESYSTEM) endif rm -f deviation-$(HGVERSION).$(EXEEXT) - -endif #BUILD_TARGET diff --git a/src/target/tx/devo/common/Makefile.devofs.inc b/src/target/tx/devo/common/Makefile.devofs.inc index 417155927a..77f5e664d6 100644 --- a/src/target/tx/devo/common/Makefile.devofs.inc +++ b/src/target/tx/devo/common/Makefile.devofs.inc @@ -1,9 +1,6 @@ -ifndef BUILD_TARGET ALL += $(ODIR)/devo.fs -else - ifdef MODULAR DEFAULT_PROTOCOLS = devo.mod dsm2.mod @@ -18,5 +15,3 @@ ifneq "$(REQUIRED_PROTOCOLS)" "" cp -pf $(REQUIRED_PROTOCOLS) $(ODIR)/tmpfs/protocol/ endif target/drivers/filesystems/devofs/buildfs.py -c -f $@ -d $(ODIR)/tmpfs - -endif diff --git a/src/target/tx/devo/common/Makefile.inc b/src/target/tx/devo/common/Makefile.inc index e2faf0b06d..685a68576a 100644 --- a/src/target/tx/devo/common/Makefile.inc +++ b/src/target/tx/devo/common/Makefile.inc @@ -2,46 +2,47 @@ HAS_4IN1_FLASH ?= 0 HAS_FLASH_DETECT ?= 0 USE_JTAG ?= 0 -ifndef BUILD_TARGET +ODIR = $(SDIR)objs/$(TARGET) +FAMILY=devo CROSS = arm-none-eabi- -EXTRA_MAKEFILES := $(EXTRA_MAKEFILES) $(SDIR)/target/tx/devo/common/Makefile.inc - -PROTO_LINKFILE = $(SDIR)/target/tx/devo/$(TARGET)/protocol.ld - -LIBOPENCM3 = $(SDIR)/libopencm3/lib/libopencm3_stm32f1.a - -SRC_C = $(wildcard $(SDIR)/target/tx/devo/$(TARGET)/*.c) \ - $(wildcard $(SDIR)/target/drivers/mcu/stm32/*.c) \ - $(wildcard $(SDIR)/target/drivers/storage/*.c) \ - $(wildcard $(SDIR)/target/drivers/indicators/*.c) \ - $(wildcard $(SDIR)/target/tx/devo/common/*.c) \ - $(addprefix $(SDIR)/target/drivers/display/, $(DISPLAY_DRIVER)) \ - $(wildcard $(SDIR)/target/drivers/filesystems/*.c) \ - $(wildcard $(SDIR)/target/drivers/filesystems/petit_fat/*.c) \ - $(wildcard $(SDIR)/target/drivers/filesystems/devofs/*.c) \ - $(wildcard $(SDIR)/target/drivers/input/button_matrix/*.c) \ - $(wildcard $(SDIR)/target/drivers/serial/uart/*.c) \ - $(wildcard $(SDIR)/target/drivers/serial/soft_serial/*.c) \ - $(wildcard $(SDIR)/target/drivers/sound/piezo/*.c) \ - $(wildcard $(SDIR)/target/drivers/sound/uart_audio/*.c) \ - $(wildcard $(SDIR)/target/drivers/usb/*.c) \ - $(SDIR)/target/drivers/backlight/backlight.c \ - $(SDIR)/target/drivers/rtc/rtc_driver.c \ - $(SDIR)/target/drivers/haptic/haptic.c \ - $(SDIR)/target/drivers/input/analog/analog.c +EXTRA_MAKEFILES := $(EXTRA_MAKEFILES) $(SDIR)target/tx/devo/common/Makefile.inc + +PROTO_LINKFILE = $(SDIR)target/tx/devo/$(TARGET)/protocol.ld + +LIBOPENCM3 = $(SDIR)libopencm3/lib/libopencm3_stm32f1.a + +SRC_C += $(wildcard $(SDIR)target/tx/devo/$(TARGET)/*.c) \ + $(wildcard $(SDIR)target/drivers/mcu/stm32/*.c) \ + $(wildcard $(SDIR)target/drivers/storage/*.c) \ + $(wildcard $(SDIR)target/drivers/indicators/*.c) \ + $(wildcard $(SDIR)target/tx/devo/common/*.c) \ + $(addprefix $(SDIR)target/drivers/display/, $(DISPLAY_DRIVER)) \ + $(wildcard $(SDIR)target/drivers/filesystems/*.c) \ + $(wildcard $(SDIR)target/drivers/filesystems/petit_fat/*.c) \ + $(wildcard $(SDIR)target/drivers/filesystems/devofs/*.c) \ + $(wildcard $(SDIR)target/drivers/input/button_matrix/*.c) \ + $(wildcard $(SDIR)target/drivers/serial/uart/*.c) \ + $(wildcard $(SDIR)target/drivers/serial/soft_serial/*.c) \ + $(wildcard $(SDIR)target/drivers/sound/piezo/*.c) \ + $(wildcard $(SDIR)target/drivers/sound/uart_audio/*.c) \ + $(wildcard $(SDIR)target/drivers/usb/*.c) \ + $(SDIR)target/drivers/backlight/backlight.c \ + $(SDIR)target/drivers/rtc/rtc_driver.c \ + $(SDIR)target/drivers/haptic/haptic.c \ + $(SDIR)target/drivers/input/analog/analog.c ifdef MODULAR -PROTO_EXTRA_C = $(wildcard $(SDIR)/target/tx/devo/common/protocol/*.c) \ - $(SDIR)/target/drivers/usb/devo_hid.c \ - $(wildcard $(SDIR)/protocol/spi/*.c) \ - $(SDIR)/target/tx/devo/common/module_signature.c \ - $(SDIR)/target/tx/devo/common/uart.c +PROTO_EXTRA_C += $(wildcard $(SDIR)target/tx/devo/common/protocol/*.c) \ + $(SDIR)target/drivers/usb/devo_hid.c \ + $(wildcard $(SDIR)protocol/spi/*.c) \ + $(SDIR)target/tx/devo/common/module_signature.c \ + $(SDIR)target/tx/devo/common/uart.c else -SRC_C += $(wildcard $(SDIR)/target/tx/devo/common/protocol/*.c) +SRC_C += $(wildcard $(SDIR)target/tx/devo/common/protocol/*.c) endif -CFLAGS = -D"assert_param(x)=" -DSTM32F10X_HD -DSTM32F1 -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fdata-sections -I$(SDIR)/target/tx/devo/common -I$(SDIR)/libopencm3/include -I$(SDIR)/target/drivers/filesystems -fno-builtin-printf -Os --specs=nano.specs +CFLAGS += -D"assert_param(x)=" -DSTM32F10X_HD -DSTM32F1 -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fdata-sections -I$(SDIR)target/tx/devo/common -I$(SDIR)libopencm3/include -I$(SDIR)target/drivers/filesystems -fno-builtin-printf -Os --specs=nano.specs ifeq "$(HAS_4IN1_FLASH)" "1" CFLAGS += -D"HAS_4IN1_FLASH=1" endif @@ -54,9 +55,9 @@ endif MODULE_CFLAGS := -fno-builtin #LFLAGS = -nostartfiles -Wl,-gc-sections -Wl,-Map=$(TARGET).map,--cref -nostdlib -LFLAGS = -nostartfiles -Wl,-gc-sections -Wl,-Map=$(TARGET).map,--cref -lc -lnosys -L$(SDIR) -L$(SDIR)/protocol -Lobjs/$(TARGET) -Wl,-warn-common +LFLAGS = -nostartfiles -Wl,-gc-sections -Wl,-Map=$(SDIR)$(TARGET).map,--cref -lc -lnosys -L$(SDIR) -L$(SDIR)protocol -L$(ODIR) -Wl,-warn-common -LINKFILE = $(SDIR)/target/tx/devo/$(TARGET)/$(TARGET).ld +LINKFILE = $(SDIR)target/tx/devo/$(TARGET)/$(TARGET).ld LFLAGS2 = -Wl,-T$(LINKFILE) ifdef ENABLE_LTO @@ -67,7 +68,7 @@ CFLAGS += -ffunction-sections endif ifdef OPTIMIZE_DFU -LINKFILEOPT = $(SDIR)/target/tx/devo/$(TARGET)/$(TARGET)_opt.ld +LINKFILEOPT = $(SDIR)target/tx/devo/$(TARGET)/$(TARGET)_opt.ld ifeq (,$(wildcard $(LINKFILEOPT))) LINKFILEOPT = $(LINKFILE) endif @@ -84,9 +85,7 @@ endif #-lnosys -ALL = $(LIBOPENCM3) $(TARGET).dfu - -else #BUILD_TARGET +ALL += $(LIBOPENCM3) $(SDIR)$(TARGET).dfu ifdef ENABLE_LTO $(foreach src,$(filter %_isr.c,$(SRCS)),\ @@ -96,38 +95,40 @@ endif ifeq ($(OS),Windows_NT) FLOCKS = else - FLOCKS = flock objs/.lock + FLOCKS = flock $(ODIR)../.lock endif -$(TARGET).bin: $(TARGET).elf +.PHONY: default +default: $(SDIR)$(TARGET).dfu + +$(SDIR)$(TARGET).bin: $(SDIR)$(TARGET).elf ifdef OPTIMIZE_DFU - $(CP) $(TARGET).elf objs/$(TARGET)/$(TARGET).elf + $(CP) $(SDIR)$(TARGET).elf $(SDIR)objs/$(TARGET)/$(TARGET).elf @echo " + Optimizing placement and re-linking" - $(SDIR)/../utils/repack_ld.pl -mapfile $(TARGET).map -linkfile $(LINKFILE) > objs/$(TARGET)/optimize.ld + $(SDIR)../utils/repack_ld.pl -mapfile $(SDIR)$(TARGET).map -linkfile $(LINKFILE) > $(SDIR)objs/$(TARGET)/optimize.ld $(CC) -o $< $(OBJS) $(LIBOPENCM3) $(LFLAGS) $(LFLAGS2OPT) $(CFLAGS) endif ifdef MODULAR # the following builds a symbol file with thumb addresses (address+1 for functions, address+0 for variables) - $(DUMP) -t $< | $(SDIR)/../utils/build_symbolfile.pl > $(SYMBOL_FILE) + $(DUMP) -t $< | $(SDIR)../utils/build_symbolfile.pl > $(SYMBOL_FILE) endif $(CP) -O binary $< $@ - $(DUMP) -S $< > $(TARGET).list + $(DUMP) -S $< > $(SDIR)$(TARGET).list -$(LIBOPENCM3): - test -s $(SDIR)/libopencm3/Makefile || { echo "Fetch libopencm3 via 'git submodule update --init'"; exit 1; } - +$(FLOCKS) $(MAKE) -C $(SDIR)/libopencm3 TARGETS=stm32/f1 lib +$(LIBOPENCM3): $(ODIR) + test -s $(SDIR)libopencm3/Makefile || { echo "Fetch libopencm3 via 'git submodule update --init'"; exit 1; } + +$(FLOCKS) $(MAKE) -C $(SDIR)libopencm3 TARGETS=stm32/f1 lib -$(TARGET).dfu: $(TARGET).bin - $(SDIR)/../utils/dfu.py --name "$(HGVERSION) Firmware" $(DFU_ARGS):$< $@ - $(SDIR)/../utils/get_mem_usage.pl $(TARGET).map +$(SDIR)$(TARGET).dfu: $(SDIR)$(TARGET).bin + $(SDIR)../utils/dfu.py --name "$(HGVERSION) Firmware" $(DFU_ARGS):$< $@ + $(SDIR)../utils/get_mem_usage.pl $(SDIR)$(TARGET).map ################################### #The protocol modules (if needed) # ################################### -$(ODIR)/%.bin: $(ODIR)/%.o_ $(SDIR)/protocol/exports.ld $(PROTO_LINKFILE) $(PROTO_EXTRA_OBJS) $(TARGET).bin +$(ODIR)%.bin: $(ODIR)%.o_ $(SDIR)protocol/exports.ld $(PROTO_LINKFILE) $(PROTO_EXTRA_OBJS) $(TARGET).bin @echo " + Building '$@'" $(LD) -o $(@:.bin=.elf) $< $(PROTO_EXTRA_OBJS) $(LIBOPENCM3) -gc-sections -Map=$(@:.bin=.map) \ --cref -T$(PROTO_LINKFILE) --just-symbols=$(SYMBOL_FILE) $(DUMP) -t $(@:.bin=.elf) | grep -q _from_thumb; if [ $$? -eq 0 ]; then echo "ERROR: Bad address found"; false; else true; fi $(CP) -O binary $(@:.bin=.elf) $@ -endif #BUILD_TARGET diff --git a/src/target/tx/devo/devo10/Makefile.inc b/src/target/tx/devo/devo10/Makefile similarity index 88% rename from src/target/tx/devo/devo10/Makefile.inc rename to src/target/tx/devo/devo10/Makefile index c53ad3faa6..055c31d293 100644 --- a/src/target/tx/devo/devo10/Makefile.inc +++ b/src/target/tx/devo/devo10/Makefile @@ -8,4 +8,7 @@ LANGUAGE := devo10 OPTIMIZE_DFU := 1 +TARGET=devo10 + include $(SDIR)/target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc diff --git a/src/target/tx/devo/devo12/Makefile.inc b/src/target/tx/devo/devo12/Makefile similarity index 97% rename from src/target/tx/devo/devo12/Makefile.inc rename to src/target/tx/devo/devo12/Makefile index 6da3707966..e3adb40f1c 100644 --- a/src/target/tx/devo/devo12/Makefile.inc +++ b/src/target/tx/devo/devo12/Makefile @@ -8,12 +8,14 @@ LANGUAGE := devo8,devo12 OPTIMIZE_DFU := 1 +TARGET=devo12 + include $(SDIR)/target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc -ifndef BUILD_TARGET ALL += $(TARGET)-lib.dfu MEDIA_FILES = -else + $(TARGET)-lib.dfu: $(LAST_MODEL) $(TARGET).dfu $(PRE_FS) /bin/rm -rf $(ODIR)/filesystem 2> /dev/null; true /bin/mkdir $(ODIR)/filesystem @@ -41,5 +43,3 @@ endif zip -u deviation-$(HGVERSION).zip debug-$(HGVERSION).zip rm -f debug-$(HGVERSION).zip rm -f deviation-$(HGVERSION).dfu - -endif #BUILD_TARGET diff --git a/src/target/tx/devo/devo12e/Makefile.inc b/src/target/tx/devo/devo12e/Makefile similarity index 88% rename from src/target/tx/devo/devo12e/Makefile.inc rename to src/target/tx/devo/devo12e/Makefile index 4c39ec597b..dddaadf6dc 100644 --- a/src/target/tx/devo/devo12e/Makefile.inc +++ b/src/target/tx/devo/devo12e/Makefile @@ -6,7 +6,7 @@ FONTS = filesystem/$(FILESYSTEM)/media/12normal.fon \ filesystem/$(FILESYSTEM)/media/04b03.fon LANGUAGE := devo10 -include $(SDIR)/target/tx/devo/common/Makefile.inc +TARGET=devo12e -ifndef BUILD_TARGET -endif +include $(SDIR)/target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/devo6/Makefile.inc b/src/target/tx/devo/devo6/Makefile similarity index 89% rename from src/target/tx/devo/devo6/Makefile.inc rename to src/target/tx/devo/devo6/Makefile index e4d21f7eef..8ccc3a9c3d 100644 --- a/src/target/tx/devo/devo6/Makefile.inc +++ b/src/target/tx/devo/devo6/Makefile @@ -6,7 +6,7 @@ FONTS = filesystem/$(FILESYSTEM)/media/15normal.fon \ filesystem/$(FILESYSTEM)/media/23bold.fon LANGUAGE := devo8 -include $(SDIR)/target/tx/devo/common/Makefile.inc +TARGET=devo6 -ifndef BUILD_TARGET -endif +include $(SDIR)/target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/devo7e-256/Makefile.inc b/src/target/tx/devo/devo7e-256/Makefile similarity index 95% rename from src/target/tx/devo/devo7e-256/Makefile.inc rename to src/target/tx/devo/devo7e-256/Makefile index 8b4451ea24..e7b69077e1 100644 --- a/src/target/tx/devo/devo7e-256/Makefile.inc +++ b/src/target/tx/devo/devo7e-256/Makefile @@ -8,17 +8,16 @@ LANGUAGE := devo10 OPTIMIZE_DFU := 1 -include $(SDIR)/target/tx/devo/common/Makefile.inc - -ifndef BUILD_TARGET - +TARGET=devo7e-256 SRC_C += $(SDIR)/target/tx/devo/devo7e/crc.c -else +include $(SDIR)/target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc + $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; has_pa-cyrf6936 = 1/ has_pa-cyrf6936 = 0/' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;switch_types: 3x2, 3x1, 2x2/;switch_types: 3x4, 3x3, 3x2, 3x1, 2x8, 2x7, 2x6, 2x5, 2x4, 2x3, 2x2, 2x1, potx2, potx1\n;May occur more than once if necessary.\n;Add nostock if stock FMOD and HOLD switches have been removed./' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;extra-switches=/; extra-switches = nostock\n; extra-switches = 3x4\n; extra-switches = 2x2\n; extra-switches = potx2/' filesystem/$(FILESYSTEM)/hardware.ini -endif + diff --git a/src/target/tx/devo/devo7e/Makefile.inc b/src/target/tx/devo/devo7e/Makefile similarity index 92% rename from src/target/tx/devo/devo7e/Makefile.inc rename to src/target/tx/devo/devo7e/Makefile index 3f601efe46..d442253905 100644 --- a/src/target/tx/devo/devo7e/Makefile.inc +++ b/src/target/tx/devo/devo7e/Makefile @@ -10,10 +10,10 @@ MODULAR := 0x20004000 DFU_ARGS := -c 7 -b 0x08003000 ENABLE_LTO := 1 +TARGET=devo7e + include $(SDIR)/target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc -ifdef BUILD_TARGET $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; has_pa-cyrf6936 = 1/ has_pa-cyrf6936 = 0/' filesystem/$(FILESYSTEM)/hardware.ini - -endif diff --git a/src/target/tx/devo/devo8/Makefile.inc b/src/target/tx/devo/devo8/Makefile similarity index 89% rename from src/target/tx/devo/devo8/Makefile.inc rename to src/target/tx/devo/devo8/Makefile index 3d178eb212..2e9fcbec3c 100644 --- a/src/target/tx/devo/devo8/Makefile.inc +++ b/src/target/tx/devo/devo8/Makefile @@ -8,4 +8,7 @@ LANGUAGE := devo8 OPTIMIZE_DFU := 1 +TARGET=devo8 + include $(SDIR)/target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/devof12e-XMS/Makefile.inc b/src/target/tx/devo/devof12e-XMS/Makefile similarity index 52% rename from src/target/tx/devo/devof12e-XMS/Makefile.inc rename to src/target/tx/devo/devof12e-XMS/Makefile index 663b53a127..f699cca9df 100644 --- a/src/target/tx/devo/devof12e-XMS/Makefile.inc +++ b/src/target/tx/devo/devof12e-XMS/Makefile @@ -7,18 +7,16 @@ FONTS = filesystem/$(FILESYSTEM)/media/f12e.fon OPTIMIZE_DFU := 1 -include $(SDIR)/target/tx/devo/common/Makefile.inc +SRC_C += $(SDIR)target/tx/devo/devof12e/channels.c \ + $(SDIR)target/tx/devo/devof12e/crc.c \ + $(SDIR)target/tx/devo/devof12e/lcd.c \ + $(SDIR)target/tx/devo/devof12e/mapped_gfx.c -ifndef BUILD_TARGET +TARGET=devof12e-XMS -SRC_C += $(SDIR)/target/tx/devo/devof12e/channels.c \ - $(SDIR)/target/tx/devo/devof12e/crc.c \ - $(SDIR)/target/tx/devo/devof12e/lcd.c \ - $(SDIR)/target/tx/devo/devof12e/mapped_gfx.c - -else +include $(SDIR)target/tx/devo/common/Makefile.inc +include $(SDIR)Makefile.inc $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/=12normal/=f12e/' filesystem/$(FILESYSTEM)/media/config.ini -endif diff --git a/src/target/tx/devo/devof12e/Makefile b/src/target/tx/devo/devof12e/Makefile new file mode 100644 index 0000000000..7e028e0760 --- /dev/null +++ b/src/target/tx/devo/devof12e/Makefile @@ -0,0 +1,19 @@ +TARGET=devof12e +SCREENSIZE := text +DISPLAY_DRIVER := i2c/video_tw8816.c +FILESYSTEMS := common text text_gfx + +DFU_ARGS := -c 12 -b 0x08004000 + +DEFAULT_PROTOCOLS := +INCLUDE_FS := 0 +OPTIMIZE_DFU := 1 + +MEDIA_FILES = +NUM_MODELS ?= 10 + +include $(SDIR)/target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc + +$(TARGET).fs_wrapper: $(LAST_MODEL) + rm filesystem/$(FILESYSTEM)/datalog.bin diff --git a/src/target/tx/devo/devof12e/Makefile.inc b/src/target/tx/devo/devof12e/Makefile.inc deleted file mode 100644 index 79e5671440..0000000000 --- a/src/target/tx/devo/devof12e/Makefile.inc +++ /dev/null @@ -1,29 +0,0 @@ -SCREENSIZE := text -DISPLAY_DRIVER := i2c/video_tw8816.c -FILESYSTEMS := common text text_gfx - -DFU_ARGS := -c 12 -b 0x08004000 - -DEFAULT_PROTOCOLS := -INCLUDE_FS := 0 -OPTIMIZE_DFU := 1 - -include $(SDIR)/target/tx/devo/common/Makefile.inc -include target/tx/devo/common/Makefile.devofs.inc - -ifndef BUILD_TARGET - -MEDIA_FILES = -NUM_MODELS ?= 10 - -else - -#$(TARGET)-lib.dfu: $(wildcard filesystem/devof7/media/*.*) $(TARGET).dfu $(PRE_FS) $(TARGET).fs_wrapper -# target/common/devo/devofs/buildfs.pl -invert filesystem/devof7 > $(ODIR)/$(TARGET)-lib.bin -# dd if=$(ODIR)/$(TARGET)-lib.bin of=$(ODIR)/$(TARGET)-lib.1.bin bs=4096 count=1 -# dd if=$(ODIR)/$(TARGET)-lib.bin of=$(ODIR)/$(TARGET)-lib.2.bin bs=4096 skip=1 -# ../utils/dfu.py --name "$(HGVERSION) Library" --alt 2 -b 0x0000:$(ODIR)/$(TARGET)-lib.1.bin --alt 1 -b 0x1000:$(ODIR)/$(TARGET)-lib.2.bin $@ - -$(TARGET).fs_wrapper: $(LAST_MODEL) - rm filesystem/$(FILESYSTEM)/datalog.bin -endif diff --git a/src/target/tx/devo/devof4-XMS/Makefile.inc b/src/target/tx/devo/devof4-XMS/Makefile similarity index 70% rename from src/target/tx/devo/devof4-XMS/Makefile.inc rename to src/target/tx/devo/devof4-XMS/Makefile index 3445c0d952..73462ac32a 100644 --- a/src/target/tx/devo/devof4-XMS/Makefile.inc +++ b/src/target/tx/devo/devof4-XMS/Makefile @@ -6,10 +6,9 @@ OPTIMIZE_DFU := 1 MODULAR := 0x20004000 DFU_ARGS := -c 4 -b 0x08003000 -include target/tx/devo/common/Makefile.inc - -ifndef BUILD_TARGET - SRC_C += $(SDIR)/target/tx/devo/devof7/crc.c -endif +TARGET=devof4-XMS + +include $(SDIR)target/tx/devo/common/Makefile.inc +include $(SDIR)Makefile.inc diff --git a/src/target/tx/devo/devof4/Makefile.inc b/src/target/tx/devo/devof4/Makefile similarity index 85% rename from src/target/tx/devo/devof4/Makefile.inc rename to src/target/tx/devo/devof4/Makefile index 6645d00fdf..449da4a5b3 100644 --- a/src/target/tx/devo/devof4/Makefile.inc +++ b/src/target/tx/devo/devof4/Makefile @@ -11,17 +11,16 @@ PRE_FS = $(ODIR)/.pre_fs INCLUDE_FS := 0 -include target/tx/devo/common/Makefile.inc -include target/tx/devo/common/Makefile.devofs.inc - -ifndef BUILD_TARGET - MEDIA_FILES = NUM_MODELS ?= 10 SRC_C += $(SDIR)/target/tx/devo/devof7/crc.c -else +TARGET=devof4 + +include $(SDIR)target/tx/devo/common/Makefile.inc +include $(SDIR)target/tx/devo/common/Makefile.devofs.inc +include $(SDIR)Makefile.inc #$(TARGET)-lib.dfu: $(wildcard filesystem/devof7/media/*.*) $(TARGET).dfu $(PRE_FS) $(TARGET).fs_wrapper # target/common/devo/devofs/buildfs.pl -invert filesystem/devof7 > $(ODIR)/$(TARGET)-lib.bin @@ -31,4 +30,3 @@ else $(TARGET).fs_wrapper: $(LAST_MODEL) rm filesystem/$(FILESYSTEM)/datalog.bin -endif diff --git a/src/target/tx/devo/devof7-XMS/Makefile.inc b/src/target/tx/devo/devof7-XMS/Makefile similarity index 74% rename from src/target/tx/devo/devof7-XMS/Makefile.inc rename to src/target/tx/devo/devof7-XMS/Makefile index eef59ec055..1920d92b3e 100644 --- a/src/target/tx/devo/devof7-XMS/Makefile.inc +++ b/src/target/tx/devo/devof7-XMS/Makefile @@ -6,11 +6,10 @@ OPTIMIZE_DFU := 1 MODULAR := 0x20004000 DFU_ARGS := -c 7 -b 0x08003000 -include target/tx/devo/common/Makefile.inc - -ifndef BUILD_TARGET - SRC_C += $(SDIR)/target/tx/devo/devof7/channels.c \ $(SDIR)/target/tx/devo/devof7/crc.c -endif +TARGET=devof7-XMS + +include $(SDIR)/target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/devof7/Makefile.inc b/src/target/tx/devo/devof7/Makefile similarity index 85% rename from src/target/tx/devo/devof7/Makefile.inc rename to src/target/tx/devo/devof7/Makefile index 29d1856619..fe55b5c673 100644 --- a/src/target/tx/devo/devof7/Makefile.inc +++ b/src/target/tx/devo/devof7/Makefile @@ -9,17 +9,16 @@ DFU_ARGS := -c 7 -b 0x08003000 PRE_FS = $(ODIR)/.pre_fs -INCLUDE_FS := 0 - -include target/tx/devo/common/Makefile.inc -include target/tx/devo/common/Makefile.devofs.inc - -ifndef BUILD_TARGET - MEDIA_FILES = NUM_MODELS ?= 10 -else +INCLUDE_FS := 0 + +TARGET=devof7 + +include $(SDIR)target/tx/devo/common/Makefile.inc +include $(SDIR)target/tx/devo/common/Makefile.devofs.inc +include $(SDIR)Makefile.inc #$(TARGET)-lib.dfu: $(wildcard filesystem/devof7/media/*.*) $(TARGET).dfu $(PRE_FS) $(TARGET).fs_wrapper # target/tx/devo/common/devofs/buildfs.pl -invert filesystem/devof7 > $(ODIR)/$(TARGET)-lib.bin @@ -29,4 +28,3 @@ else $(TARGET).fs_wrapper: $(LAST_MODEL) rm filesystem/$(FILESYSTEM)/datalog.bin -endif diff --git a/src/target/tx/devo/emu_devo12e/Makefile.inc b/src/target/tx/devo/emu_devo10/Makefile similarity index 64% rename from src/target/tx/devo/emu_devo12e/Makefile.inc rename to src/target/tx/devo/emu_devo10/Makefile index 7653e8d659..456c6b8fa6 100644 --- a/src/target/tx/devo/emu_devo12e/Makefile.inc +++ b/src/target/tx/devo/emu_devo10/Makefile @@ -4,4 +4,8 @@ FONTS = filesystem/$(FILESYSTEM)/media/12normal.fon \ filesystem/$(FILESYSTEM)/media/04b03.fon LANGUAGE := devo10 -include target/drivers/mcu/emu/Makefile.inc +TARGET = emu_devo10 +FAMILY = devo + +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/emu_devo12/Makefile.inc b/src/target/tx/devo/emu_devo12/Makefile similarity index 66% rename from src/target/tx/devo/emu_devo12/Makefile.inc rename to src/target/tx/devo/emu_devo12/Makefile index 1a0ab7fb82..98394a0884 100644 --- a/src/target/tx/devo/emu_devo12/Makefile.inc +++ b/src/target/tx/devo/emu_devo12/Makefile @@ -4,4 +4,8 @@ FONTS = filesystem/$(FILESYSTEM)/media/15normal.fon \ filesystem/$(FILESYSTEM)/media/23bold.fon LANGUAGE := devo8,devo12 -include target/drivers/mcu/emu/Makefile.inc +TARGET = emu_devo12 +FAMILY = devo + +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/emu_devo10/Makefile.inc b/src/target/tx/devo/emu_devo12e/Makefile similarity index 63% rename from src/target/tx/devo/emu_devo10/Makefile.inc rename to src/target/tx/devo/emu_devo12e/Makefile index 7653e8d659..ffecc4b3cd 100644 --- a/src/target/tx/devo/emu_devo10/Makefile.inc +++ b/src/target/tx/devo/emu_devo12e/Makefile @@ -4,4 +4,8 @@ FONTS = filesystem/$(FILESYSTEM)/media/12normal.fon \ filesystem/$(FILESYSTEM)/media/04b03.fon LANGUAGE := devo10 -include target/drivers/mcu/emu/Makefile.inc +TARGET = emu_devo12e +FAMILY = devo + +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/emu_devo6/Makefile.inc b/src/target/tx/devo/emu_devo6/Makefile similarity index 64% rename from src/target/tx/devo/emu_devo6/Makefile.inc rename to src/target/tx/devo/emu_devo6/Makefile index 7314d25d56..21bff12a00 100644 --- a/src/target/tx/devo/emu_devo6/Makefile.inc +++ b/src/target/tx/devo/emu_devo6/Makefile @@ -4,4 +4,8 @@ FONTS = filesystem/$(FILESYSTEM)/media/15normal.fon \ filesystem/$(FILESYSTEM)/media/23bold.fon LANGUAGE :=devo8 -include target/drivers/mcu/emu/Makefile.inc +TARGET = emu_devo6 +FAMILY = devo + +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/emu_devo7e-256/Makefile.inc b/src/target/tx/devo/emu_devo7e-256/Makefile similarity index 86% rename from src/target/tx/devo/emu_devo7e-256/Makefile.inc rename to src/target/tx/devo/emu_devo7e-256/Makefile index d8c1535339..0450313077 100644 --- a/src/target/tx/devo/emu_devo7e-256/Makefile.inc +++ b/src/target/tx/devo/emu_devo7e-256/Makefile @@ -4,11 +4,13 @@ FONTS = filesystem/$(FILESYSTEM)/media/12normal.fon \ filesystem/$(FILESYSTEM)/media/04b03.fon LANGUAGE := devo10 -include target/drivers/mcu/emu/Makefile.inc +TARGET = emu_devo7e-256 +FAMILY = devo + +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc -ifdef BUILD_TARGET $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; has_pa-cyrf6936 = 1/ has_pa-cyrf6936 = 0/' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;switch_types: 3x2, 3x1, 2x2/;switch_types: 3x4, 3x3, 3x2, 3x1, 2x8, 2x7, 2x6, 2x5, 2x4, 2x3, 2x2, 2x1, potx2, potx1\n;May occur more than once if necessary.\n;Add nostock if stock FMOD and HOLD switches have been removed./' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;extra-switches=/; extra-switches = nostock\n; extra-switches = 3x4\n; extra-switches = 2x2\n; extra-switches = potx2/' filesystem/$(FILESYSTEM)/hardware.ini -endif diff --git a/src/target/tx/devo/emu_devo7e/Makefile.inc b/src/target/tx/devo/emu_devo7e/Makefile similarity index 74% rename from src/target/tx/devo/emu_devo7e/Makefile.inc rename to src/target/tx/devo/emu_devo7e/Makefile index 7cc08f2353..89c353d90d 100644 --- a/src/target/tx/devo/emu_devo7e/Makefile.inc +++ b/src/target/tx/devo/emu_devo7e/Makefile @@ -4,9 +4,11 @@ FONTS = filesystem/$(FILESYSTEM)/media/12normal.fon \ filesystem/$(FILESYSTEM)/media/04b03.fon LANGUAGE = devo10 -include target/drivers/mcu/emu/Makefile.inc +TARGET = emu_devo7e +FAMILY = devo + +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc -ifdef BUILD_TARGET $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; has_pa-cyrf6936 = 1/ has_pa-cyrf6936 = 0/' filesystem/$(FILESYSTEM)/hardware.ini -endif diff --git a/src/target/tx/devo/emu_devo8/Makefile.inc b/src/target/tx/devo/emu_devo8/Makefile similarity index 65% rename from src/target/tx/devo/emu_devo8/Makefile.inc rename to src/target/tx/devo/emu_devo8/Makefile index d671a923c3..00d6146421 100644 --- a/src/target/tx/devo/emu_devo8/Makefile.inc +++ b/src/target/tx/devo/emu_devo8/Makefile @@ -3,5 +3,8 @@ FILESYSTEMS := common base_fonts 320x240x16 FONTS = filesystem/$(FILESYSTEM)/media/15normal.fon \ filesystem/$(FILESYSTEM)/media/23bold.fon LANGUAGE := devo8 +TARGET = emu_devo8 +FAMILY = devo -include target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/emu_devof12e-XMS/Makefile b/src/target/tx/devo/emu_devof12e-XMS/Makefile new file mode 100644 index 0000000000..4da4f8eb7c --- /dev/null +++ b/src/target/tx/devo/emu_devof12e-XMS/Makefile @@ -0,0 +1,22 @@ +SCREENSIZE := text +FILESYSTEMS := common text text_gfx +LANGUAGE := devo10 +FONTS = filesystem/$(FILESYSTEM)/media/f12e.fon + +TARGET = emu_devof12e-XMS +FAMILY = devo + +SRC_C += $(SDIR)target/tx/devo/devof12e/lcd.c \ + $(SDIR)target/tx/devo/devof12e/mapped_gfx.c \ + $(SDIR)target/tx/devo/emu_devof12e/channels.c \ + $(SDIR)target/tx/devo/emu_devof12e/tw8816.c \ + $(SDIR)target/tx/devo/emu_devof12e/tw8816_map.c + +CFLAGS += -I$(SDIR)target/tx/devo/emu_devof12e + +include $(SDIR)target/drivers/mcu/emu/Makefile.inc +include $(SDIR)Makefile.inc + +$(TARGET).fs_wrapper: $(LAST_MODEL) + perl -p -i -e 's/=12normal/=f12e/' filesystem/$(FILESYSTEM)/media/config.ini + diff --git a/src/target/tx/devo/emu_devof12e-XMS/Makefile.inc b/src/target/tx/devo/emu_devof12e-XMS/Makefile.inc deleted file mode 100644 index c70bea2db5..0000000000 --- a/src/target/tx/devo/emu_devof12e-XMS/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -SCREENSIZE := text -FILESYSTEMS := common text text_gfx -LANGUAGE := devo10 -FONTS = filesystem/$(FILESYSTEM)/media/f12e.fon - -include target/drivers/mcu/emu/Makefile.inc - -ifdef BUILD_TARGET - -$(TARGET).fs_wrapper: $(LAST_MODEL) - perl -p -i -e 's/=12normal/=f12e/' filesystem/$(FILESYSTEM)/media/config.ini - -endif diff --git a/src/target/tx/devo/emu_devof12e-XMS/capabilities.h b/src/target/tx/devo/emu_devof12e-XMS/capabilities.h deleted file mode 100644 index 79901c5090..0000000000 --- a/src/target/tx/devo/emu_devof12e-XMS/capabilities.h +++ /dev/null @@ -1 +0,0 @@ -#include "../devof12e/capabilities.h" diff --git a/src/target/tx/devo/emu_devof12e-XMS/channels.c b/src/target/tx/devo/emu_devof12e-XMS/channels.c deleted file mode 100644 index dc018fa70f..0000000000 --- a/src/target/tx/devo/emu_devof12e-XMS/channels.c +++ /dev/null @@ -1 +0,0 @@ -#include "../emu_devof12e/channels.c" diff --git a/src/target/tx/devo/emu_devof12e-XMS/char_map.h b/src/target/tx/devo/emu_devof12e-XMS/char_map.h deleted file mode 100644 index aa1ed4b515..0000000000 --- a/src/target/tx/devo/emu_devof12e-XMS/char_map.h +++ /dev/null @@ -1 +0,0 @@ -#include "../devof12e/char_map.h" diff --git a/src/target/tx/devo/emu_devof12e-XMS/lcd.c b/src/target/tx/devo/emu_devof12e-XMS/lcd.c deleted file mode 100644 index 350f9eae90..0000000000 --- a/src/target/tx/devo/emu_devof12e-XMS/lcd.c +++ /dev/null @@ -1 +0,0 @@ -#include "../emu_devof12e/lcd.c" diff --git a/src/target/tx/devo/emu_devof12e-XMS/lcd.h b/src/target/tx/devo/emu_devof12e-XMS/lcd.h deleted file mode 100644 index 1dfe05cc78..0000000000 --- a/src/target/tx/devo/emu_devof12e-XMS/lcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "../emu_devof12e/lcd.h" diff --git a/src/target/tx/devo/emu_devof12e-XMS/lcd_page_props.h b/src/target/tx/devo/emu_devof12e-XMS/lcd_page_props.h deleted file mode 100644 index c97e16061b..0000000000 --- a/src/target/tx/devo/emu_devof12e-XMS/lcd_page_props.h +++ /dev/null @@ -1 +0,0 @@ -#include "../devof12e/lcd_page_props.h" diff --git a/src/target/tx/devo/emu_devof12e-XMS/mapped_gfx.c b/src/target/tx/devo/emu_devof12e-XMS/mapped_gfx.c deleted file mode 100644 index 0000d29cf0..0000000000 --- a/src/target/tx/devo/emu_devof12e-XMS/mapped_gfx.c +++ /dev/null @@ -1 +0,0 @@ -#include "../devof12e/mapped_gfx.c" diff --git a/src/target/tx/devo/emu_devof12e-XMS/tw8816.c b/src/target/tx/devo/emu_devof12e-XMS/tw8816.c deleted file mode 100644 index c73a03abee..0000000000 --- a/src/target/tx/devo/emu_devof12e-XMS/tw8816.c +++ /dev/null @@ -1 +0,0 @@ -#include "../emu_devof12e/tw8816.c" diff --git a/src/target/tx/devo/emu_devof12e-XMS/tw8816_map.c b/src/target/tx/devo/emu_devof12e-XMS/tw8816_map.c deleted file mode 100644 index 879296892e..0000000000 --- a/src/target/tx/devo/emu_devof12e-XMS/tw8816_map.c +++ /dev/null @@ -1 +0,0 @@ -#include "target/drivers/display/i2c/tw8816_map.h" diff --git a/src/target/tx/devo/emu_devof12e/Makefile b/src/target/tx/devo/emu_devof12e/Makefile new file mode 100644 index 0000000000..ea654cff52 --- /dev/null +++ b/src/target/tx/devo/emu_devof12e/Makefile @@ -0,0 +1,9 @@ +SCREENSIZE := text +NUM_MODELS ?= 10 +FILESYSTEMS := common text text_gfx + +TARGET = emu_devof12e +FAMILY = devo + +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/emu_devof12e/Makefile.inc b/src/target/tx/devo/emu_devof12e/Makefile.inc deleted file mode 100644 index 803cdc4c09..0000000000 --- a/src/target/tx/devo/emu_devof12e/Makefile.inc +++ /dev/null @@ -1,6 +0,0 @@ -SCREENSIZE := text -NUM_MODELS ?= 10 -FILESYSTEMS := common text text_gfx - - -include target/drivers/mcu/emu/Makefile.inc diff --git a/src/target/tx/devo/emu_devof7/Makefile b/src/target/tx/devo/emu_devof7/Makefile new file mode 100644 index 0000000000..cae364d797 --- /dev/null +++ b/src/target/tx/devo/emu_devof7/Makefile @@ -0,0 +1,12 @@ +SCREENSIZE := text +NUM_MODELS ?= 10 +FILESYSTEMS := common text + +TARGET = emu_devof7 +FAMILY = devo + +SRC += $(SDIR)/target/tx/devo/devof7/ia9211_map.c +CFLAGS +=-I$(SDIR)/target/drivers/display/spi/ + +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc \ No newline at end of file diff --git a/src/target/tx/devo/emu_devof7/Makefile.inc b/src/target/tx/devo/emu_devof7/Makefile.inc deleted file mode 100644 index d2d868ba6a..0000000000 --- a/src/target/tx/devo/emu_devof7/Makefile.inc +++ /dev/null @@ -1,6 +0,0 @@ -SCREENSIZE := text -NUM_MODELS ?= 10 -FILESYSTEMS := common text - - -include target/drivers/mcu/emu/Makefile.inc diff --git a/src/target/tx/devo/emu_devof7/ia9211_map.c b/src/target/tx/devo/emu_devof7/ia9211_map.c deleted file mode 100644 index a99285ae8a..0000000000 --- a/src/target/tx/devo/emu_devof7/ia9211_map.c +++ /dev/null @@ -1 +0,0 @@ -#include "../devof7/ia9211_map.c" diff --git a/src/target/tx/devo/emu_devof7/lcd.c b/src/target/tx/devo/emu_devof7/lcd.c index 73465c5c26..835fa731d7 100644 --- a/src/target/tx/devo/emu_devof7/lcd.c +++ b/src/target/tx/devo/emu_devof7/lcd.c @@ -21,6 +21,7 @@ #include "lcd.h" #include "ia9211_font.h" #include "ia9211_bigfont.h" +#include "ia9211_map.h" struct rgb { u8 r; diff --git a/src/target/tx/devo/emu_t8sg/Makefile.inc b/src/target/tx/devo/emu_t8sg/Makefile similarity index 92% rename from src/target/tx/devo/emu_t8sg/Makefile.inc rename to src/target/tx/devo/emu_t8sg/Makefile index d13aac908e..c0515491fa 100644 --- a/src/target/tx/devo/emu_t8sg/Makefile.inc +++ b/src/target/tx/devo/emu_t8sg/Makefile @@ -4,9 +4,12 @@ FONTS = filesystem/$(FILESYSTEM)/media/12normal.fon \ filesystem/$(FILESYSTEM)/media/04b03.fon LANGUAGE := devo10 -include target/drivers/mcu/emu/Makefile.inc +TARGET = emu_t8sg +FAMILY = devo + +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc -ifdef BUILD_TARGET $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; enable-a7105 = A13/ enable-a7105 = A13/' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/; has_pa-a7105 = 1/ has_pa-a7105 = 1/' filesystem/$(FILESYSTEM)/hardware.ini @@ -17,4 +20,3 @@ $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/;switch_types: 3x2, 3x1, 2x2/;switch_types: 3x4, 3x3, 3x2, 3x1, 2x8, 2x7, 2x6, 2x5, 2x4, 2x3, 2x2, 2x1, potx2, potx1\n;May occur more than once if necessary.\n;Add nostock if stock FMOD and HOLD switches have been removed./' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;extra-switches=/ extra-switches = nostock\n extra-switches = 3x4\n; extra-switches = 2x2\n extra-switches = potx2/' filesystem/$(FILESYSTEM)/hardware.ini rm -f filesystem/$(FILESYSTEM)/hardware.ini.bak -endif diff --git a/src/target/tx/devo/emu_t8sg_v2/Makefile.inc b/src/target/tx/devo/emu_t8sg_v2/Makefile similarity index 92% rename from src/target/tx/devo/emu_t8sg_v2/Makefile.inc rename to src/target/tx/devo/emu_t8sg_v2/Makefile index a483c567bb..7becc1fee9 100644 --- a/src/target/tx/devo/emu_t8sg_v2/Makefile.inc +++ b/src/target/tx/devo/emu_t8sg_v2/Makefile @@ -4,9 +4,12 @@ FONTS = filesystem/$(FILESYSTEM)/media/12normal.fon \ filesystem/$(FILESYSTEM)/media/04b03.fon LANGUAGE := devo10 -include target/drivers/mcu/emu/Makefile.inc +TARGET = emu_t8sg_v2 +FAMILY = devo + +include $(SDIR)/target/drivers/mcu/emu/Makefile.inc +include $(SDIR)/Makefile.inc -ifdef BUILD_TARGET $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; enable-a7105 = A13/ enable-a7105 = A13/' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/; has_pa-a7105 = 1/ has_pa-a7105 = 1/' filesystem/$(FILESYSTEM)/hardware.ini @@ -17,4 +20,3 @@ $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/;switch_types: 3x2, 3x1, 2x2/;switch_types: 3x4, 3x3, 3x2, 3x1, 2x8, 2x7, 2x6, 2x5, 2x4, 2x3, 2x2, 2x1, potx2, potx1\n;May occur more than once if necessary.\n;Add nostock if stock FMOD and HOLD switches have been removed./' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;extra-switches=/ extra-switches = nostock\n extra-switches = 3x4\n extra-switches = 2x2\n extra-switches = potx2/' filesystem/$(FILESYSTEM)/hardware.ini rm -f filesystem/$(FILESYSTEM)/hardware.ini.bak -endif diff --git a/src/target/tx/devo/ir8m/Makefile.inc b/src/target/tx/devo/ir8m/Makefile similarity index 93% rename from src/target/tx/devo/ir8m/Makefile.inc rename to src/target/tx/devo/ir8m/Makefile index 367db43209..993e334177 100644 --- a/src/target/tx/devo/ir8m/Makefile.inc +++ b/src/target/tx/devo/ir8m/Makefile @@ -7,9 +7,10 @@ LANGUAGE := devo10 OPTIMIZE_DFU := 1 -include $(SDIR)/target/tx/devo/common/Makefile.inc +TARGET := ir8m -ifdef BUILD_TARGET +include $(SDIR)target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; enable-a7105 = A13/ enable-a7105 = A13/' filesystem/$(FILESYSTEM)/hardware.ini @@ -21,5 +22,3 @@ $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/;switch_types: 3x2, 3x1, 2x2/;switch_types: 3x4, 3x3, 3x2, 3x1, 2x8, 2x7, 2x6, 2x5, 2x4, 2x3, 2x2, 2x1, potx2, potx1\n;May occur more than once if necessary.\n;Add nostock if stock FMOD and HOLD switches have been removed./' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;extra-switches=/ extra-switches = nostock\n extra-switches = 3x4\n; extra-switches = 2x2\n extra-switches = potx2/' filesystem/$(FILESYSTEM)/hardware.ini rm -f filesystem/$(FILESYSTEM)/hardware.ini.bak - -endif diff --git a/src/target/tx/devo/t8sg/Makefile.inc b/src/target/tx/devo/t8sg/Makefile similarity index 93% rename from src/target/tx/devo/t8sg/Makefile.inc rename to src/target/tx/devo/t8sg/Makefile index 469f09d1ac..3adb7f912e 100644 --- a/src/target/tx/devo/t8sg/Makefile.inc +++ b/src/target/tx/devo/t8sg/Makefile @@ -8,9 +8,10 @@ LANGUAGE := devo10 OPTIMIZE_DFU := 1 -include $(SDIR)/target/tx/devo/common/Makefile.inc +TARGET := t8sg -ifdef BUILD_TARGET +include $(SDIR)target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; enable-a7105 = A13/ enable-a7105 = A13/' filesystem/$(FILESYSTEM)/hardware.ini @@ -22,5 +23,3 @@ $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/;switch_types: 3x2, 3x1, 2x2/;switch_types: 3x4, 3x3, 3x2, 3x1, 2x8, 2x7, 2x6, 2x5, 2x4, 2x3, 2x2, 2x1, potx2, potx1\n;May occur more than once if necessary.\n;Add nostock if stock FMOD and HOLD switches have been removed./' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;extra-switches=/ extra-switches = nostock\n extra-switches = 3x4\n; extra-switches = 2x2\n extra-switches = potx2/' filesystem/$(FILESYSTEM)/hardware.ini rm -f filesystem/$(FILESYSTEM)/hardware.ini.bak - -endif diff --git a/src/target/tx/devo/t8sg_v2/Makefile.inc b/src/target/tx/devo/t8sg_v2/Makefile similarity index 90% rename from src/target/tx/devo/t8sg_v2/Makefile.inc rename to src/target/tx/devo/t8sg_v2/Makefile index 2bebf9a46e..1c52b91f6a 100644 --- a/src/target/tx/devo/t8sg_v2/Makefile.inc +++ b/src/target/tx/devo/t8sg_v2/Makefile @@ -8,9 +8,10 @@ LANGUAGE := devo10 OPTIMIZE_DFU := 1 -include $(SDIR)/target/tx/devo/common/Makefile.inc +TARGET := t8sg_v2 -ifdef BUILD_TARGET +include $(SDIR)target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; enable-a7105 = A13/ enable-a7105 = A13/' filesystem/$(FILESYSTEM)/hardware.ini @@ -21,6 +22,4 @@ $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; has_pa-nrf24l01 = 1/ has_pa-nrf24l01 = 1/' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;switch_types: 3x2, 3x1, 2x2/;switch_types: 3x4, 3x3, 3x2, 3x1, 2x8, 2x7, 2x6, 2x5, 2x4, 2x3, 2x2, 2x1, potx2, potx1\n;May occur more than once if necessary.\n;Add nostock if stock FMOD and HOLD switches have been removed./' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;extra-switches=/ extra-switches = nostock\n extra-switches = 3x4\n extra-switches = 2x2\n extra-switches = potx2/' filesystem/$(FILESYSTEM)/hardware.ini - rm -f filesystem/$(FILESYSTEM)/hardware.ini.bak - -endif + rm -f filesystem/$(FILESYSTEM)/hardware.ini.bak \ No newline at end of file diff --git a/src/target/tx/devo/t8sg_v2_plus/Makefile.inc b/src/target/tx/devo/t8sg_v2_plus/Makefile similarity index 93% rename from src/target/tx/devo/t8sg_v2_plus/Makefile.inc rename to src/target/tx/devo/t8sg_v2_plus/Makefile index 04b33d1c12..0524be3e18 100644 --- a/src/target/tx/devo/t8sg_v2_plus/Makefile.inc +++ b/src/target/tx/devo/t8sg_v2_plus/Makefile @@ -8,9 +8,10 @@ LANGUAGE := devo10 OPTIMIZE_DFU := 1 -include $(SDIR)/target/tx/devo/common/Makefile.inc +TARGET := t8sg_v2_plus -ifdef BUILD_TARGET +include $(SDIR)target/tx/devo/common/Makefile.inc +include $(SDIR)/Makefile.inc $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/; enable-a7105 = A13/ enable-a7105 = A13/' filesystem/$(FILESYSTEM)/hardware.ini @@ -22,5 +23,3 @@ $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/;switch_types: 3x2, 3x1, 2x2/;switch_types: 3x4, 3x3, 3x2, 3x1, 2x8, 2x7, 2x6, 2x5, 2x4, 2x3, 2x2, 2x1, potx2, potx1\n;May occur more than once if necessary.\n;Add nostock if stock FMOD and HOLD switches have been removed./' filesystem/$(FILESYSTEM)/hardware.ini perl -p -i -e 's/;extra-switches=/ extra-switches = nostock\n extra-switches = 3x4\n extra-switches = 2x2\n extra-switches = potx2/' filesystem/$(FILESYSTEM)/hardware.ini rm -f filesystem/$(FILESYSTEM)/hardware.ini.bak - -endif diff --git a/src/target/tx/opentx/t12/Makefile b/src/target/tx/opentx/t12/Makefile new file mode 100644 index 0000000000..7cf53a2445 --- /dev/null +++ b/src/target/tx/opentx/t12/Makefile @@ -0,0 +1,60 @@ +SCREENSIZE := 128x64x1 +DFU_ARGS := -b 0x08000000 +FILESYSTEMS := common base_fonts 128x64x1 +FONTS = filesystem/$(FILESYSTEM)/media/12normal.fon \ + filesystem/$(FILESYSTEM)/media/04b03.fon +LANGUAGE := devo10 + +FAMILY = opentx +TARGET = t12 + +CROSS = arm-none-eabi- + +LINKFILE = $(SDIR)target/tx/$(FAMILY)/$(TARGET)/$(TARGET).ld + +LIBOPENCM3 = $(SDIR)libopencm3/lib/libopencm3_stm32f2.a + +SRC_C = $(wildcard $(SDIR)target/tx/$(FAMILY)/$(TARGET)/*.c) \ + $(SDIR)target/drivers/display/spi/128x64x1_nt7538.c \ + $(wildcard $(SDIR)target/drivers/mcu/stm32/*.c) \ + $(wildcard $(SDIR)target/drivers/serial/soft_serial/*.c) \ + $(wildcard $(SDIR)target/drivers/serial/usb_cdc/*.c) \ + $(SDIR)target/drivers/filesystems/FatFs/ff.c \ + $(SDIR)target/drivers/filesystems/FatFs/fattime.c \ + $(SDIR)target/drivers/filesystems/FatFs/option/ccsbcs.c \ + $(wildcard $(SDIR)target/drivers/storage/mmc_flash/*.c) \ + $(wildcard $(SDIR)target/drivers/filesystems/*.c) \ + $(SDIR)target/drivers/backlight/backlight.c \ + $(SDIR)target/drivers/haptic/haptic.c \ + $(SDIR)target/drivers/rtc/rtc_driver.c \ + $(SDIR)target/drivers/input/analog/analog.c \ + $(SDIR)target/drivers/indicators/led.c \ + $(SDIR)target/drivers/input/button_switch/button_switch.c + +CFLAGS = -D"assert_param(x)=" -DSTM32F20X_HD -DSTM32F2 -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fdata-sections -ffunction-sections -I$(SDIR)libopencm3/include -fno-builtin-printf -Os -I$(SDIR)target/drivers/filesystems +MODULE_FLAGS = -fno-builtin + +LFLAGS = -nostartfiles -Wl,-gc-sections -Wl,-Map=$(SDIR)$(TARGET).map,--cref -lc +LFLAGS2 = -Wl,-T$(LINKFILE) +LFLAGS2OPT = -Wl,-Ttarget/$(TARGET)/$(TARGET)_opt.ld + +.PHONY: default +default: $(SDIR)$(TARGET).bin + +#-lnosys + +ALL = $(LIBOPENCM3) $(SDIR)$(TARGET).bin + +$(SDIR)$(TARGET).bin: $(SDIR)$(TARGET).elf + $(CP) -O binary $< $@ + $(DUMP) -S $< > $(SDIR)$(TARGET).list + +$(LIBOPENCM3): $(ODIR) + test -s $(SDIR)libopencm3/Makefile || { echo "Fetch libopencm3 via 'git submodule update --init'"; exit 1; } + +$(FLOCKS) $(MAKE) -C $(SDIR)libopencm3 TARGETS=stm32/f2 lib + +$(SDIR)$(TARGET).dfu: $(LIBOPENCM3) $(SDIR)$(TARGET).bin + $(SDIR)../utils/dfu.py --name "$(HGVERSION) Firmware" $(DFU_ARGS):$< $@ + $(SDIR)../utils/get_mem_usage.pl $(SDIR)$(TARGET).map + +include $(SDIR)Makefile.inc diff --git a/src/target/tx/opentx/t12/Makefile.inc b/src/target/tx/opentx/t12/Makefile.inc deleted file mode 100644 index 2b10f2744b..0000000000 --- a/src/target/tx/opentx/t12/Makefile.inc +++ /dev/null @@ -1,57 +0,0 @@ -SCREENSIZE := 128x64x1 -DFU_ARGS := -b 0x08000000 -FILESYSTEMS := common base_fonts 128x64x1 -FONTS = filesystem/$(FILESYSTEM)/media/12normal.fon \ - filesystem/$(FILESYSTEM)/media/04b03.fon -LANGUAGE := devo10 - -ifndef BUILD_TARGET - -CROSS = arm-none-eabi- - -LINKFILE = $(SDIR)/target/tx/$(FAMILY)/$(TARGET)/$(TARGET).ld - -LIBOPENCM3 = libopencm3/lib/libopencm3_stm32f2.a - -SRC_C = $(wildcard target/tx/$(FAMILY)/$(TARGET)/*.c) \ - target/drivers/display/spi/128x64x1_nt7538.c \ - $(wildcard target/drivers/mcu/stm32/*.c) \ - $(wildcard target/drivers/serial/soft_serial/*.c) \ - $(wildcard target/drivers/serial/usb_cdc/*.c) \ - target/drivers/filesystems/FatFs/ff.c \ - target/drivers/filesystems/FatFs/fattime.c \ - target/drivers/filesystems/FatFs/option/ccsbcs.c \ - $(wildcard target/drivers/storage/mmc_flash/*.c) \ - $(wildcard target/drivers/filesystems/*.c) \ - target/drivers/backlight/backlight.c \ - target/drivers/haptic/haptic.c \ - target/drivers/rtc/rtc_driver.c \ - target/drivers/input/analog/analog.c \ - target/drivers/indicators/led.c \ - target/drivers/input/button_switch/button_switch.c - -CFLAGS = -D"assert_param(x)=" -DSTM32F20X_HD -DSTM32F2 -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fdata-sections -ffunction-sections -Ilibopencm3/include -fno-builtin-printf -Os -I$(SDIR)/target/drivers/filesystems -MODULE_FLAGS = -fno-builtin - -LFLAGS = -nostartfiles -Wl,-gc-sections -Wl,-Map=$(TARGET).map,--cref -lc -LFLAGS2 = -Wl,-T$(LINKFILE) -LFLAGS2OPT = -Wl,-Ttarget/$(TARGET)/$(TARGET)_opt.ld - -#-lnosys - -ALL = $(TARGET).dfu - -else #BUILD_TARGET - -$(TARGET).bin: $(TARGET).elf - $(CP) -O binary $< $@ - $(DUMP) -S $< > $(TARGET).list - -$(LIBOPENCM3): - make -C libopencm3 TARGETS=stm32/f2 lib - -$(TARGET).dfu: $(TARGET).bin - ../utils/dfu.py --name "$(HGVERSION) Firmware" $(DFU_ARGS):$< $@ - ../utils/get_mem_usage.pl $(TARGET).map - -endif #BUILD_TARGET diff --git a/src/target/tx/other/test/Makefile b/src/target/tx/other/test/Makefile new file mode 100644 index 0000000000..1b72bb68f6 --- /dev/null +++ b/src/target/tx/other/test/Makefile @@ -0,0 +1,40 @@ +SCREENSIZE := 320x240x16 +FILESYSTEMS := common base_fonts 320x240x16 +FONTS = filesystem/$(FILESYSTEM)/media/15normal.fon \ + filesystem/$(FILESYSTEM)/media/23bold.fon +LANGUAGE := devo8 + +TARGET = test +FAMILY = other + +CFLAGS += -DTEST --coverage -g -O0 -fPIC +SRC_C += $(wildcard $(SDIR)target/tx/$(FAMILY)/$(TARGET)/*.c) \ + $(wildcard $(SDIR)target/drivers/filesystems/*.c) + +ifdef USE_INTERNAL_FS +SRC_C += $(wildcard $(SDIR)target/drivers/filesystems/devofs/*.c) \ + $(wildcard $(SDIR)target/drivers/filesystems/petit_fat/*.c) +CFLAGS = -DEMULATOR=USE_INTERNAL_FS +else +CFLAGS = -DEMULATOR=USE_NATIVE_FS +endif + +TYPE ?= dev + +CFLAGS += -I$(SDIR)target/drivers/filesystems +LFLAGS += -lz + +SRC_C += objs/test/AllTests.c + +CFLAGS += -DFILESYSTEM_DIR="\"filesystem/$(FILESYSTEM)\"" + +EXEEXT = +ALL += $(ODIR)AllTests.c $(TARGET).$(EXEEXT) + +default: $(ODIR)AllTests.c $(TARGET).$(EXEEXT) + +$(ODIR)AllTests.c: make-tests.sh $(SDIR)tests/*.c + echo $(PWD) + sh make-tests.sh > $(ODIR)AllTests.c + +include $(SDIR)Makefile.inc diff --git a/src/target/tx/other/test/Makefile.inc b/src/target/tx/other/test/Makefile.inc deleted file mode 100644 index 4843023877..0000000000 --- a/src/target/tx/other/test/Makefile.inc +++ /dev/null @@ -1,36 +0,0 @@ -SCREENSIZE := 320x240x16 -FILESYSTEMS := common base_fonts 320x240x16 -FONTS = filesystem/$(FILESYSTEM)/media/15normal.fon \ - filesystem/$(FILESYSTEM)/media/23bold.fon -LANGUAGE := devo8 - -CFLAGS += -DTEST --coverage -g -O0 -fPIC -ifndef BUILD_TARGET - -SRC_C = $(wildcard $(SDIR)/target/tx/$(FAMILY)/$(TARGET)/*.c) \ - $(wildcard $(SDIR)/target/drivers/filesystems/*.c) - -ifdef USE_INTERNAL_FS -SRC_C += $(wildcard $(SDIR)/target/drivers/filesystems/devofs/*.c) \ - $(wildcard $(SDIR)/target/drivers/filesystems/petit_fat/*.c) -CFLAGS = -DEMULATOR=USE_INTERNAL_FS -else -CFLAGS = -DEMULATOR=USE_NATIVE_FS -endif - -CFLAGS += -I$(SDIR)/target/drivers/filesystems -LFLAGS += -lz - -ALL = $(TARGET).$(EXEEXT) - -TYPE ?= dev - -SRC_C += objs/test/AllTests.c - -else #BUILD_TARGET -CFLAGS += -DFILESYSTEM_DIR="\"filesystem/$(FILESYSTEM)\"" - -objs/test/AllTests.c: target/tx/$(FAMILY)/$(TARGET)/make-tests.sh tests/*.c - sh target/tx/$(FAMILY)/$(TARGET)/make-tests.sh > $(ODIR)/AllTests.c - -endif #BUILD_TARGET diff --git a/src/target/tx/other/test/make-tests.sh b/src/target/tx/other/test/make-tests.sh index 93a44667b0..722c488c6d 100755 --- a/src/target/tx/other/test/make-tests.sh +++ b/src/target/tx/other/test/make-tests.sh @@ -5,6 +5,7 @@ # Prints to stdout. # Author: Asim Jalis # Date: 01/08/2003 +echo $PWD FILES=`find tests/ -name '*.c' | sort` echo ' diff --git a/src/target/tx/radiolink/at10/Makefile.inc b/src/target/tx/radiolink/at10/Makefile similarity index 67% rename from src/target/tx/radiolink/at10/Makefile.inc rename to src/target/tx/radiolink/at10/Makefile index 75f268fac7..ff00be81a3 100644 --- a/src/target/tx/radiolink/at10/Makefile.inc +++ b/src/target/tx/radiolink/at10/Makefile @@ -9,28 +9,30 @@ FILESYSTEMS := common base_fonts 320x240x16 else FILESYSTEMS := common base_fonts 320x240x1 endif - -include $(SDIR)/target/tx/radiolink/common/Makefile.inc - -ifndef BUILD_TARGET +TARGET = at10 ALL = $(LIBOPENCM3) $(TARGET).bin $(TARGET).mac -SRC_C += $(SDIR)/target/drivers/display/8080/320x240x16.c \ - $(wildcard $(SDIR)/target/drivers/input/rotary/*.c) +SRC_C += $(SDIR)target/drivers/display/8080/320x240x16.c \ + $(wildcard $(SDIR)target/drivers/input/rotary/*.c) ifneq "$(HAS_4IN1_FLASH)" "1" -SRC_C := $(filter-out $(SDIR)/target/common/stm32/spi_flash.c, $(SRC_C)) +SRC_C := $(filter-out $(SDIR)target/common/stm32/spi_flash.c, $(SRC_C)) endif -else #BUILD_TARGET -$(TARGET).mac: $(TARGET).bin - cat $(SDIR)/target/tx/radiolink/at10/header.mac $(TARGET).bin > $@ +.PHONY: default +default: $(SDIR)$(TARGET).mac + +include $(SDIR)target/tx/radiolink/common/Makefile.inc +include $(SDIR)Makefile.inc -$(TARGET).bin: $(TARGET).elf $(ODIR)/devo.fs +$(SDIR)$(TARGET).mac: $(SDIR)$(TARGET).bin + cat $(SDIR)target/tx/radiolink/at10/header.mac $(TARGET).bin > $@ + +$(SDIR)$(TARGET).bin: $(SDIR) $(TARGET).elf $(ODIR)/devo.fs $(CP) -O binary $(TARGET).elf $(ODIR)/$@ $(DUMP) -S $(TARGET).elf > $(TARGET).list - $(SDIR)/../utils/get_mem_usage.pl $(TARGET).map + $(SDIR)../utils/get_mem_usage.pl $(TARGET).map ifneq "$(HAS_4IN1_FLASH)" "1" # padding firmware to 216KB truncate --size=216K $(ODIR)/$@ @@ -42,7 +44,7 @@ $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/drawn_background=0/drawn_background=1/' filesystem/$(FILESYSTEM)/media/config.ini rm filesystem/$(FILESYSTEM)/datalog.bin -$(TARGET).zip: $(ALL) +$(SDIR)$(TARGET).zip: $(ALL) cp -f $(TARGET).bin deviation-$(HGVERSION).bin cp -f $(TARGET).mac deviation-$(HGVERSION).mac rm -f deviation-$(HGVERSION).zip @@ -51,6 +53,4 @@ $(TARGET).zip: $(ALL) # make zipping more compatible with other distributions zip deviation-$(HGVERSION).zip deviation-$(HGVERSION).mac deviation-$(HGVERSION).bin $(EXTRA_DFUS) zip -u deviation-$(HGVERSION).zip debug-$(HGVERSION).zip - rm -f debug-$(HGVERSION).zip - -endif #BUILD_TARGET + rm -f debug-$(HGVERSION).zip \ No newline at end of file diff --git a/src/target/tx/radiolink/at9/Makefile.inc b/src/target/tx/radiolink/at9/Makefile similarity index 57% rename from src/target/tx/radiolink/at9/Makefile.inc rename to src/target/tx/radiolink/at9/Makefile index 92a3adbf67..c1d3b8b8b1 100644 --- a/src/target/tx/radiolink/at9/Makefile.inc +++ b/src/target/tx/radiolink/at9/Makefile @@ -12,37 +12,39 @@ endif DFU_ARGS := -D 0x0483:0xdf12 -b 0x08003000 -include $(SDIR)/target/tx/radiolink/common/Makefile.inc - -ifndef BUILD_TARGET +TARGET = at9 ifneq "$(HAS_4IN1_FLASH)" "1" EXTRA_DFUS = $(TARGET)-fs.dfu endif -ALL = $(LIBOPENCM3) $(TARGET).dfu $(EXTRA_DFUS) +.PHONY: default +default: $(SDIR)$(TARGET).dfu + +ALL = $(LIBOPENCM3) $(SDIR)$(TARGET).dfu $(EXTRA_DFUS) -SRC_C += $(SDIR)/target/drivers/display/8080/320x240x16.c \ - $(wildcard $(SDIR)/target/drivers/input/rotary/*.c) +SRC_C += $(SDIR)target/drivers/display/8080/320x240x16.c \ + $(wildcard $(SDIR)target/drivers/input/rotary/*.c) -else #BUILD_TARGET +include $(SDIR)target/tx/radiolink/common/Makefile.inc +include $(SDIR)Makefile.inc -$(TARGET).bin: $(TARGET).elf +$(SDIR)$(TARGET).bin: $(SDIR)$(TARGET).elf $(CP) -O binary $< $@ - $(DUMP) -S $< > $(TARGET).list + $(DUMP) -S $< > $(SDIR)$(TARGET).list -$(TARGET).dfu: $(TARGET).bin - $(SDIR)/../utils/dfu.py --name "$(HGVERSION) Firmware" $(DFU_ARGS):$< $@ - $(SDIR)/../utils/get_mem_usage.pl $(TARGET).map +$(SDIR)$(TARGET).dfu: $(SDIR)$(TARGET).bin + $(SDIR)../utils/dfu.py --name "$(HGVERSION) Firmware" $(DFU_ARGS):$< $@ + $(SDIR)../utils/get_mem_usage.pl $(SDIR)$(TARGET).map -$(TARGET)-fs.dfu: $(ODIR)/devo.fs - $(SDIR)/../utils/dfu.py --name "$(HGVERSION) Filesystem" -D 0x0483:0xdf12 -b 0x08040000:$< $@ +$(SDIR)$(TARGET)-fs.dfu: $(ODIR)/devo.fs + $(SDIR)../utils/dfu.py --name "$(HGVERSION) Filesystem" -D 0x0483:0xdf12 -b 0x08040000:$< $@ $(TARGET).fs_wrapper: $(LAST_MODEL) perl -p -i -e 's/=15normal/=15ascii/' filesystem/$(FILESYSTEM)/media/config.ini rm filesystem/$(FILESYSTEM)/datalog.bin -$(TARGET).zip: $(ALL) +$(SDIR)$(TARGET).zip: $(ALL) cp -f $(TARGET).dfu deviation-$(HGVERSION).dfu rm -f deviation-$(HGVERSION).zip rm -f debug-$(HGVERSION).zip @@ -52,5 +54,3 @@ $(TARGET).zip: $(ALL) zip -u deviation-$(HGVERSION).zip debug-$(HGVERSION).zip rm -f debug-$(HGVERSION).zip rm -f deviation-$(HGVERSION).dfu - -endif #BUILD_TARGET diff --git a/src/target/tx/radiolink/common/Makefile.inc b/src/target/tx/radiolink/common/Makefile.inc index b131fce2c8..3d8051abee 100644 --- a/src/target/tx/radiolink/common/Makefile.inc +++ b/src/target/tx/radiolink/common/Makefile.inc @@ -1,8 +1,11 @@ -ifndef BUILD_TARGET CROSS = arm-none-eabi- -LINKFILE = $(SDIR)/target/tx/$(FAMILY)/$(TARGET)/$(TARGET).ld -LIBOPENCM3 = $(SDIR)/libopencm3/lib/libopencm3_stm32f1.a +FAMILY = radiolink + +ODIR = $(SDIR)objs/$(TARGET) + +LINKFILE = $(SDIR)target/tx/$(FAMILY)/$(TARGET)/$(TARGET).ld +LIBOPENCM3 = $(SDIR)libopencm3/lib/libopencm3_stm32f1.a ifeq "$(HAS_4IN1_FLASH)" "1" NUM_MODELS ?= 30 @@ -10,50 +13,54 @@ else NUM_MODELS ?= 10 endif -SRC_C := $(wildcard $(SDIR)/target/tx/$(FAMILY)/common/*.c) \ - $(wildcard $(SDIR)/target/tx/$(FAMILY)/$(TARGET)/*.c) \ - $(wildcard $(SDIR)/target/drivers/mcu/stm32/*.c) \ - $(wildcard $(SDIR)/target/drivers/indicators/*.c) \ - $(wildcard $(SDIR)/target/drivers/filesystems/*.c) \ - $(wildcard $(SDIR)/target/drivers/filesystems/devofs/*.c) \ - $(wildcard $(SDIR)/target/drivers/filesystems/petit_fat/*.c) \ - $(wildcard $(SDIR)/target/tx/devo/common/protocol/*.c) \ - $(wildcard $(SDIR)/target/drivers/serial/uart/*.c) \ - $(wildcard $(SDIR)/target/drivers/usb/*.c) \ - $(SDIR)/target/drivers/storage/mcu_flash.c \ - $(SDIR)/target/drivers/backlight/backlight.c \ - $(SDIR)/target/drivers/input/analog/analog.c +SRC_C += $(wildcard $(SDIR)target/tx/$(FAMILY)/common/*.c) \ + $(wildcard $(SDIR)target/tx/$(FAMILY)/$(TARGET)/*.c) \ + $(wildcard $(SDIR)target/drivers/mcu/stm32/*.c) \ + $(wildcard $(SDIR)target/drivers/indicators/*.c) \ + $(wildcard $(SDIR)target/drivers/filesystems/*.c) \ + $(wildcard $(SDIR)target/drivers/filesystems/devofs/*.c) \ + $(wildcard $(SDIR)target/drivers/filesystems/petit_fat/*.c) \ + $(wildcard $(SDIR)target/tx/devo/common/protocol/*.c) \ + $(wildcard $(SDIR)target/drivers/serial/uart/*.c) \ + $(wildcard $(SDIR)target/drivers/usb/*.c) \ + $(SDIR)target/drivers/storage/mcu_flash.c \ + $(SDIR)target/drivers/backlight/backlight.c \ + $(SDIR)target/drivers/input/analog/analog.c + +ifeq ($(OS),Windows_NT) + FLOCKS = +else + FLOCKS = flock $(ODIR)../.lock +endif ifeq "$(HAS_4IN1_FLASH)" "1" -SRC_C += $(SDIR)/target/drivers/storage/spi_flash.c +SRC_C += $(SDIR)target/drivers/storage/spi_flash.c endif -CFLAGS = -D"assert_param(x)=" -DSTM32F10X_HD -DSTM32F1 -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fdata-sections -ffunction-sections -I$(SDIR)/libopencm3/include -I$(SDIR)/target/drivers/filesystems -I$(SDIR)/target/tx/radiolink/common -fno-builtin-printf -Os --specs=nano.specs +CFLAGS = -D"assert_param(x)=" -DSTM32F10X_HD -DSTM32F1 -mcpu=cortex-m3 -mthumb -mfix-cortex-m3-ldrd -fdata-sections -I$(SDIR)libopencm3/include -I$(SDIR)target/drivers/filesystems -I$(SDIR)target/tx/radiolink/common -fno-builtin-printf -Os --specs=nano.specs ifeq "$(HAS_4IN1_FLASH)" "1" CFLAGS += -D"HAS_4IN1_FLASH=1" endif MODULE_CFLAGS = -fno-builtin -LFLAGS = -nostartfiles -Wl,-gc-sections -Wl,-Map=$(TARGET).map,--cref -lc -lnosys -L$(SDIR) -L$(SDIR)/protocol -Lobjs/$(TARGET) +LFLAGS = -nostartfiles -Wl,-gc-sections -Wl,-Map=$(SDIR)$(TARGET).map,--cref -lc -lnosys -L$(SDIR) -L$(SDIR)protocol -L$(ODIR) LFLAGS2 = -Wl,-T$(LINKFILE) ifdef ENABLE_LTO CFLAGS += -flto -ffat-lto-objects -fwhole-program -DENABLE_LTO +else +CFLAGS += -ffunction-sections endif -else #BUILD_TARGET - ifdef ENABLE_LTO $(foreach src,$(filter %_isr.c,$(SRCS)),\ - $(eval CFLAGS_$(basename $(notdir $(src))) = -fno-lto)) + $(eval CFLAGS_$(basename $(notdir $(src))) = -fno-lto)) endif -$(LIBOPENCM3): - test -s $(SDIR)/libopencm3/Makefile || { echo "Fetch libopencm3 via 'git submodule update --init'"; exit 1; } - +$(MAKE) -C $(SDIR)/libopencm3 TARGETS=stm32/f1 lib +$(SDIR)$(LIBOPENCM3): $(ODIR) + test -s $(SDIR)libopencm3/Makefile || { echo "Fetch libopencm3 via 'git submodule update --init'"; exit 1; } + +$(FLOCKS) $(MAKE) -C $(SDIR)libopencm3 TARGETS=stm32/f1 lib $(ODIR)/devo.fs: $(LAST_MODEL) $(PRE_FS) $(TARGET).fs_wrapper - target/drivers/filesystems/devofs/buildfs.py -c -i -f $@ -d filesystem/$(FILESYSTEM) - -endif #BUILD_TARGET + target/drivers/filesystems/devofs/buildfs.py -c -i -f $@ -d $(SDIR)/filesystem/$(FILESYSTEM) diff --git a/src/target/tx/radiolink/emu_at10/Makefile.inc b/src/target/tx/radiolink/emu_at10/Makefile similarity index 100% rename from src/target/tx/radiolink/emu_at10/Makefile.inc rename to src/target/tx/radiolink/emu_at10/Makefile diff --git a/src/target/tx/radiolink/emu_at9/Makefile.inc b/src/target/tx/radiolink/emu_at9/Makefile similarity index 100% rename from src/target/tx/radiolink/emu_at9/Makefile.inc rename to src/target/tx/radiolink/emu_at9/Makefile