aboutsummaryrefslogtreecommitdiff
path: root/projects/VSCode/Makefile
diff options
context:
space:
mode:
authorMurray Campbell <MurrayIRC@gmail.com>2018-10-24 14:37:42 -0500
committerGitHub <noreply@github.com>2018-10-24 14:37:42 -0500
commitbcbe042dd2a9a07146eea62c844287fe2bfdc141 (patch)
treee2bdadb6ad9263df43c5504d497860961caa02af /projects/VSCode/Makefile
parent03fb5499a0f2c4b45ed1b2655a6e1e77221ed46a (diff)
parentd916ac9b5dc4966aca1fb3ac4aaf3aead5ed9d4f (diff)
downloadraylib-bcbe042dd2a9a07146eea62c844287fe2bfdc141.tar.gz
raylib-bcbe042dd2a9a07146eea62c844287fe2bfdc141.zip
Merge pull request #8 from MurrayIRC/vscode-updates
Vscode updates
Diffstat (limited to 'projects/VSCode/Makefile')
-rw-r--r--projects/VSCode/Makefile17
1 files changed, 13 insertions, 4 deletions
diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile
index 9794c1ab..83e26053 100644
--- a/projects/VSCode/Makefile
+++ b/projects/VSCode/Makefile
@@ -151,6 +151,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),LINUX)
MAKE = make
endif
+ ifeq ($(PLATFORM_OS),OSX)
+ MAKE = make
+ endif
endif
# Define compiler flags:
@@ -279,17 +282,22 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
endif
+# Define a recursive wildcard function
+rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
+
# Define all source files required
-PROJECT_SOURCE_FILES ?= main.c
+SRC_DIR = src
+OBJ_DIR = obj
# Define all object files from source files
-OBJS = $(patsubst %.c, %.o, $(PROJECT_SOURCE_FILES))
+SRC = $(call rwildcard, *.c, *.h)
+OBJS = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
# For Android platform we call a custom Makefile.Android
ifeq ($(PLATFORM),PLATFORM_ANDROID)
MAKEFILE_PARAMS = -f Makefile.Android
export PROJECT_NAME
- export PROJECT_SOURCE_FILES
+ export SRC_DIR
else
MAKEFILE_PARAMS = $(PROJECT_NAME)
endif
@@ -305,7 +313,8 @@ $(PROJECT_NAME): $(OBJS)
# Compile source files
# NOTE: This pattern will compile every module defined on $(OBJS)
-%.o: %.c
+#%.o: %.c
+$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
$(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM)
# Clean everything