From 553f700b794edab2ce0726251038627e18f2f505 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 6 Aug 2016 15:57:32 +0300 Subject: [PATCH] Fixed needless deep generation, which caused errors when compiling the Cocoa GUI when SDL is not installed --- Makefile | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 04a02a8..ebd2d3f 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,16 @@ ifeq ($(shell uname -s),Darwin) -default: cocoa +DEFAULT := cocoa else -default: sdl +DEFAULT := sdl endif VERSION := 0.5 +default: $(DEFAULT) + +ifeq ($(MAKECMDGOALS),) +MAKECMDGOALS := $(DEFAULT) +endif + BIN := build/bin OBJ := build/obj @@ -50,8 +56,15 @@ SDL_OBJECTS := $(patsubst %,$(OBJ)/%.o,$(SDL_SOURCES)) ALL_OBJECTS := $(CORE_OBJECTS) $(COCOA_OBJECTS) $(SDL_OBJECTS) # Automatic dependency generation - --include $(ALL_OBJECTS:.o=.dep) +ifneq ($(MAKECMDGOALS),clean) +-include $(CORE_OBJECTS:.o=.dep) +ifneq ($(filter $(MAKECMDGOALS),sdl),) +-include $(SDL_OBJECTS:.o=.dep) +endif +ifneq ($(filter $(MAKECMDGOALS),cocoa),) +-include $(COCOA_OBJECTS:.o=.dep) +endif +endif $(OBJ)/%.dep: % -@mkdir -p $(dir $@)