gnumake object files stored in gnumake/objects.

This commit is contained in:
Mikko Mononen 2010-10-24 13:22:31 +00:00
parent 646e8c1aec
commit 2dd22d024a
3 changed files with 11 additions and 6 deletions

View File

@ -1,20 +1,25 @@
BIN = RecastDemo/Bin
BUILD = RecastDemo/Build/GNUMake
OBJ = $(BUILD)/Objects
# Add new targets here and add a corresponding
# .mk file to RecastDemo/Build/GNUMake
TARGETS = DebugUtils Detour Recast RecastDemo
# Dependencies
RecastDemo: DebugUtils Detour Recast
RecastDemo: $(OBJ) DebugUtils Detour Recast
$(OBJ):
mkdir -p $(OBJ)
all: $(TARGETS)
$(TARGETS):
make BIN=$(BIN) BUILD=$(BUILD) -f $(BUILD)/$(@).mk
make BIN=$(BIN) BUILD=$(BUILD) OBJ=$(OBJ) -f $(BUILD)/$(@).mk
CLEAN_TARGETS = $(foreach target,$(TARGETS),$(target)-clean)
clean: $(CLEAN_TARGETS)
rm -rf $(OBJ)
$(CLEAN_TARGETS): %-clean:
make BIN=$(BIN) BUILD=$(BUILD) -f $(BUILD)/$(*).mk clean
make BIN=$(BIN) BUILD=$(BUILD) OBJ=$(OBJ) -f $(BUILD)/$(*).mk clean
.PHONY: all clean $(TARGETS) $(CLEAN_TARGETS)

View File

@ -1,7 +1,7 @@
OBJECTS = $(patsubst $(NAME)/Source/%.cpp,$(BIN)/%.o,$(wildcard $(NAME)/Source/*.cpp))
OBJECTS = $(patsubst $(NAME)/Source/%.cpp,$(OBJ)/%.o,$(wildcard $(NAME)/Source/*.cpp))
CPPFLAGS += -I$(NAME)/Include
$(BIN)/%.o: $(NAME)/Source/%.cpp
$(OBJ)/%.o: $(NAME)/Source/%.cpp
c++ $(CPPFLAGS) -c -o $@ $<
.PHONY: clean

View File

@ -4,4 +4,4 @@ $(BIN)/$(NAME): $(OBJECTS)
c++ $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
clean:
rm -f $(BIN)/$(NAME).a $(BIN)/$(NAME)
rm -f $(BIN)/$(NAME).a $(OBJECTS)