diff options
author | Gregwar <g.passault@gmail.com> | 2014-11-11 20:08:20 +0100 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2015-05-27 20:51:59 -0700 |
commit | e400311df8c08515f6bc60b8a16432613eac5967 (patch) | |
tree | a509b0ec9cd1685d9b9d80752dfbf2ee07840bfc | |
parent | 205c1c69d1691cdaecd1068515302e618fb1b9f9 (diff) | |
download | librambutan-e400311df8c08515f6bc60b8a16432613eac5967.tar.gz librambutan-e400311df8c08515f6bc60b8a16432613eac5967.zip |
[Makefile] Easier adding of sources
Signed-off-by: Grégoire Passault <g.passault@gmail.com>, Quentin Rouxel
<qrouxel@labri.fr>
-rw-r--r-- | build-targets.mk | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/build-targets.mk b/build-targets.mk index aaff2d0..4b9c880 100644 --- a/build-targets.mk +++ b/build-targets.mk @@ -1,5 +1,8 @@ -# main project target -$(BUILD_PATH)/main.o: $(SRCROOT)/main.cpp +# Sources to compile +SRC_FILES = main.cpp +OBJ_FILES = $(addprefix $(BUILD_PATH)/,$(SRC_FILES:.cpp=.o)) + +$(BUILD_PATH)/%.o: %.cpp $(SILENT_CXX) $(CXX) $(CFLAGS) $(CXXFLAGS) $(LIBMAPLE_INCLUDES) $(WIRISH_INCLUDES) -o $@ -c $< $(BUILD_PATH)/libmaple.a: $(BUILDDIRS) $(TGT_BIN) @@ -10,7 +13,7 @@ library: $(BUILD_PATH)/libmaple.a .PHONY: library -$(BUILD_PATH)/$(BOARD).elf: $(BUILDDIRS) $(TGT_BIN) $(BUILD_PATH)/main.o +$(BUILD_PATH)/$(BOARD).elf: $(BUILDDIRS) $(TGT_BIN) $(OBJ_FILES) $(SILENT_LD) $(CXX) $(LDFLAGS) -o $@ $(TGT_BIN) $(BUILD_PATH)/main.o -Wl,-Map,$(BUILD_PATH)/$(BOARD).map $(BUILD_PATH)/$(BOARD).bin: $(BUILD_PATH)/$(BOARD).elf |