Skip to content

Commit

Permalink
Updated makefile to remove errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubspy committed Oct 28, 2021
1 parent 639e5a7 commit 14f0473
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,16 @@ $(EXE_NAME) : $(GAME_OBJS)
release : $(GAME_OBJS)
$(CC) $^ $(CXX_FLAGS) $(LINKER_FLAGS) -o $(EXE_NAME)

$(OBJ_DIR)/main.o: $(SRC_DIR)/main.cpp
$(dir_guard)
$(CC) $^ $(CXX_FLAGS) $(DEBUG_FLAGS) -c -o $@

# Here we're gonna override the default make rule for turning cpp files into object files
# Because we need to make sure the obj files are compiled using the correct version
# $< is the first prerequisite, so it doesn't compile with the .h file
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
$(dir_guard)
$(CC) $^ $(CXX_FLAGS) $(DEBUG_FLAGS) -c -o $@
$(CC) $< $(CXX_FLAGS) $(DEBUG_FLAGS) -c -o $@

clean:
rm $(EXE_NAME) $(GAME_OBJS) $(COAL_OBJS)

0 comments on commit 14f0473

Please sign in to comment.