summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 7 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index abd17f8..d98733d 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,13 @@ libs:
run: $(EXE_DIR)/$(PROJECT).ELF
$(GBSIM) $^
-depend: $(DEPS)
+-include $(DEPS)
+
+$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(OBJ_DIR)/%.d
+ $(CXX) $< -o $@ $(INCLUDE) $(DEFINE) $(CC_FLAGS) -MMD
+
+$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(OBJ_DIR)/%.d
+ $(CC) $< -o $@ $(INCLUDE) $(DEFINE) $(CC_FLAGS) -MMD
$(OBJ_DIR)/%.d: $(SRC_DIR)/%.c
$(CC) $< $(DEFINE) $(INCLUDE) -M -MF $@
@@ -41,14 +47,6 @@ $(OBJ_DIR)/%.d: $(SRC_DIR)/%.c
$(OBJ_DIR)/%.d: $(SRC_DIR)/%.cpp
$(CXX) $< $(DEFINE) $(INCLUDE) -M -MF $@
-$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(OBJ_DIR)/%.d
- $(CXX) $< -o $@ $(INCLUDE) $(DEFINE) $(CC_FLAGS)
-
-$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(OBJ_DIR)/%.d
- $(CC) $< -o $@ $(INCLUDE) $(DEFINE) $(CC_FLAGS)
-
--include $(DEPS)
-
clean:
rm *.elf -f
rm $(OBJ_DIR)/*.o $(OBJ_DIR)/*.d -f