# Definitionen 
CXX_FLAGS ?= -Os -fno-use-cxa-atexit -fno-exceptions -fno-rtti -ffunction-sections -nostartfiles -static -I src --include config.h

CXX ?= g++

HDR := $(wildcard src/*.h)
SRC := $(wildcard src/*.cc)
OBJ := $(SRC:%.cc=%.o)


# Regeln
all: test1 test2 test3 

test% : test%.cc $(SRC) $(HDR) config.h
	@echo
	@echo $@: using $(CXX) with $(CXX_FLAGS)
	@$(CXX) $(CXX_FLAGS) -D $@_build -Xlinker -T -Xlinker sections -Wl,--gc-sections -o $@ $< $(SRC)  

sizes: all
	@echo
	@size test?

clean:
	@rm -f $(OBJ) test?.o
	@rm -f test?

.PHONY: clean 

