diff options
author | Gregwar <g.passault@gmail.com> | 2014-11-11 20:08:20 +0100 |
---|---|---|
committer | bryan newbold <bnewbold@twinleaf.com> | 2014-11-26 01:10:58 -0800 |
commit | 422a4c67554f31570f06fab0469b094e985b3675 (patch) | |
tree | 2f2187c5f05a8cd1611b00bd2b8071b3b044773a | |
parent | 91f5b9ec4f37f99be235a460e4f6d924ec2cf2a9 (diff) | |
download | librambutan-422a4c67554f31570f06fab0469b094e985b3675.tar.gz librambutan-422a4c67554f31570f06fab0469b094e985b3675.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 |