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
33 changes: 0 additions & 33 deletions include/builder/live_dyn_var.h

This file was deleted.

22 changes: 16 additions & 6 deletions make/buildit_rules.mk
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
# Actual rules for building the library and the executables
.PRECIOUS: $(BUILD_DIR)/%.o
.PRECIOUS: $(BUILD_DIR)/samples/%.o
.SECONDARY: $(BUILD_DIR)/%.o
.SECONDARY: $(BUILD_DIR)/samples/%.o

$(BUILD_DIR)/gen_headers/gen/compiler_headers.h:
@mkdir -p $(@D)
@echo "#pragma once" > $@
@echo "#define GEN_TEMPLATE_NAME \"$(BASE_DIR)/scratch/code_XXXXXX\"" >> $@
@echo "#define COMPILER_PATH \"$(CC)\"" >> $@
@echo "#define CXX_COMPILER_PATH \"$(CXX)\"" >> $@
$(LIBRARY_OBJS): $(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp $(INCLUDES) $(DEPS_LIST)

$(LIBRARY_OBJS): $(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp $(GEN_INCLUDES)
@mkdir -p $(@D)
$(CXXV) $(CFLAGS_INTERNAL) $(CFLAGS) $< -o $@ $(INCLUDE_FLAGS) -c
$(BUILD_DIR)/samples/%.o: $(SAMPLES_DIR)/%.cpp $(INCLUDES) $(DEPS_LIST)
$(CXXV) $(CFLAGS_INTERNAL) $(CFLAGS) $< -o $@ $(INCLUDE_FLAGS) -c -MMD -MP -MT $@ -MF $(@:.o=.td)
@mv -f $(@:.o=.td) $(@:.o=.d)

$(BUILD_DIR)/samples/%.o: $(SAMPLES_DIR)/%.cpp $(GEN_INCLUDES)
@mkdir -p $(@D)
$(CXXV) $(CFLAGS_INTERNAL) $(CFLAGS) $< -o $@ $(INCLUDE_FLAGS) -c
$(CXXV) $(CFLAGS_INTERNAL) $(CFLAGS) $< -o $@ $(INCLUDE_FLAGS) -c -MMD -MP -MT $@ -MF $(@:.o=.td)
@mv -f $(@:.o=.td) $(@:.o=.d)

$(LIBRARY): $(LIBRARY_OBJS) $(DEPS_LIST)
@mkdir -p $(@D)
$(ARV) cr $(LIBRARY) $(LIBRARY_OBJS)

$(BUILD_DIR)/sample%: $(BUILD_DIR)/samples/sample%.o $(LIBRARY) $(DEPS_LIST)
@mkdir -p $(@D)
$(CXXLDV) -o $@ $< $(LINKER_FLAGS)

.PHONY: executables
executables: $(SAMPLES)


-include $(LIBRARY_OBJS:.o=.d)
-include $(SAMPLE_OBJS:.o=.d)
5 changes: 4 additions & 1 deletion make/dirs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ 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=))
INCLUDES=$(wildcard $(INCLUDE_DIR)/*.h) $(wildcard $(INCLUDE_DIR)/*/*.h) $(BUILD_DIR)/gen_headers/gen/compiler_headers.h

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

BUILDER_SRC=$(wildcard $(SRC_DIR)/builder/*.cpp)
Expand All @@ -18,6 +20,7 @@ UTIL_SRC=$(wildcard $(SRC_DIR)/util/*.cpp)
BUILDER_OBJS=$(subst $(SRC_DIR),$(BUILD_DIR),$(BUILDER_SRC:.cpp=.o))
BLOCKS_OBJS=$(subst $(SRC_DIR),$(BUILD_DIR),$(BLOCKS_SRC:.cpp=.o))
UTIL_OBJS=$(subst $(SRC_DIR),$(BUILD_DIR),$(UTIL_SRC:.cpp=.o))
SAMPLE_OBJS=$(subst $(SAMPLES_DIR),$(BUILD_DIR)/samples,$(SAMPLES_SRCS:.cpp=.o))

LIBRARY_OBJS=$(BUILDER_OBJS) $(BLOCKS_OBJS) $(UTIL_OBJS)
LIBRARY=$(BUILD_DIR)/lib$(LIBRARY_NAME).a
Expand Down