A more general approach to ignore everything with stm32f1xx. Should also

work with Windows GNU make
This commit is contained in:
phl0 2017-04-06 17:31:46 +02:00
parent 12e0f409ca
commit a062f504da
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A
1 changed files with 3 additions and 1 deletions

View File

@ -35,19 +35,21 @@ BINDIR=bin
ifdef SYSTEMROOT ifdef SYSTEMROOT
ASOURCES=$(shell dir /S /B *.s) ASOURCES=$(shell dir /S /B *.s)
CSOURCES=$(shell dir /S /B *.c) CSOURCES=$(shell dir /S /B *.c)
CSOURCES:=$(foreach a,$(CSOURCES),$(if $(findstring stm32f1xx,$a),,$a))
CXXSOURCES=$(shell dir /S /B *.cpp) CXXSOURCES=$(shell dir /S /B *.cpp)
CLEANCMD=del /S *.o *.hex *.bin *.elf CLEANCMD=del /S *.o *.hex *.bin *.elf
MDBIN=md $@ MDBIN=md $@
else ifdef SystemRoot else ifdef SystemRoot
ASOURCES=$(shell dir /S /B *.s) ASOURCES=$(shell dir /S /B *.s)
CSOURCES=$(shell dir /S /B *.c) CSOURCES=$(shell dir /S /B *.c)
CSOURCES:=$(foreach a,$(CSOURCES),$(if $(findstring stm32f1xx,$a),,$a))
CXXSOURCES=$(shell dir /S /B *.cpp) CXXSOURCES=$(shell dir /S /B *.cpp)
CLEANCMD=del /S *.o *.hex *.bin *.elf CLEANCMD=del /S *.o *.hex *.bin *.elf
MDBIN=md $@ MDBIN=md $@
else else
ASOURCES=$(shell find . -name '*.s') ASOURCES=$(shell find . -name '*.s')
CSOURCES=$(shell find . -name '*.c') CSOURCES=$(shell find . -name '*.c')
CSOURCES:=$(filter-out $(wildcard ./system_stm32f1xx/*.c), $(CSOURCES)) CSOURCES:=$(foreach a,$(CSOURCES),$(if $(findstring stm32f1xx,$a),,$a))
CXXSOURCES=$(shell find . -name '*.cpp') CXXSOURCES=$(shell find . -name '*.cpp')
CLEANCMD=rm -f $(OBJECTS) $(BINDIR)/$(BINELF) $(BINDIR)/$(BINHEX) $(BINDIR)/$(BINBIN) CLEANCMD=rm -f $(OBJECTS) $(BINDIR)/$(BINELF) $(BINDIR)/$(BINHEX) $(BINDIR)/$(BINBIN)
MDBIN=mkdir $@ MDBIN=mkdir $@