Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions make/buildit_rules.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Actual rules for building the library and the executables
.SECONDARY: $(BUILD_DIR)/%.o
.SECONDARY: $(BUILD_DIR)/samples/%.o
.PRECIOUS: $(BUILD_DIR)/%.o
.PRECIOUS: $(BUILD_DIR)/samples/%.o

$(BUILD_DIR)/gen_headers/gen/compiler_headers.h:
@mkdir -p $(@D)
Expand All @@ -27,9 +27,15 @@ $(BUILD_DIR)/sample%: $(BUILD_DIR)/samples/sample%.o $(LIBRARY) $(DEPS_LIST)
@mkdir -p $(@D)
$(CXXLDV) -o $@ $< $(LINKER_FLAGS)


# Extra rules to simply compile the samples by name
$(SAMPLE_NAMES): sample%: $(BUILD_DIR)/sample%

.PHONY: executables
executables: $(SAMPLES)

.PHONY: lib
lib: $(LIBRARY)

-include $(LIBRARY_OBJS:.o=.d)
-include $(SAMPLE_OBJS:.o=.d)
1 change: 1 addition & 0 deletions make/dirs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SAMPLES_DIR=$(BASE_DIR)/samples
DEPS_DIR=$(BASE_DIR)/deps
SAMPLES_SRCS=$(wildcard $(SAMPLES_DIR)/*.cpp)
SAMPLES=$(subst $(SAMPLES_DIR),$(BUILD_DIR),$(SAMPLES_SRCS:.cpp=))
SAMPLE_NAMES=$(subst $(SAMPLES_DIR)/,,$(SAMPLES_SRCS:.cpp=))

GEN_INCLUDES=$(BUILD_DIR)/gen_headers/gen/compiler_headers.h
INCLUDES=$(wildcard $(INCLUDE_DIR)/*.h) $(wildcard $(INCLUDE_DIR)/*/*.h) $(GEN_INCLUDES)
Expand Down
Loading