TARGET=sbm BUILD_DIR=build MK_DIR=mkdir -p CPP_SRCS= \ src/main.cpp #TOOLCHAIN=armv7a-unknown-linux-gnueabihf TOOLCHAIN= CC=$(TOOLCHAIN)-g++ SIZE=$(TOOLCHAIN)-size CFLAGS=-Og -Wall -fdata-sections -ffunction-sections -g3 -DDEBUG INCLUDES=\ cfg\ inc all: bin/$(TARGET) OBJS=$(addprefix $(BUILD_DIR)/,$(notdir $(CPP_SRCS:.cpp=.o))) vpath %.cpp $(sort $(dir $(CPP_SRCS))) $(BUILD_DIR)/%.o: %.cpp Makefile | $(BUILD_DIR) $(CC) -c $(CFLAGS) $< -o $@ bin/$(TARGET): $(OBJS) Makefile $(CC) $(OBJS) -o $@ size $@ $(BUILD_DIR): mkdir $@ clean: @rm -fR $(BUILD_DIR) @rm -f bin/$(TARGET)