-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (30 loc) · 1.13 KB
/
Makefile
File metadata and controls
36 lines (30 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Copyright (c) 2020-present Caps Collective & contributors
# Originally authored by Jonathan Moallem (@jonjondev) & Aryeh Zinn (@Raelr)
#
# This code is released under an unmodified zlib license.
# For conditions of distribution and use, please see:
# https://opensource.org/licenses/Zlib
include $(makeDir)/Functions.mk
include $(makeDir)/Platform.mk
# Set source build vars
coreSrcDir := ./
coreBinDir := $(binDir)/engine/core
coreSources := $(call rwildcard,$(coreSrcDir)/,*.cpp)
coreObjects := $(call findobjs,$(coreSrcDir),$(coreBinDir),$(coreSources))
coreDepends := $(patsubst %.o, %.d, $(call rwildcard,$(coreBinDir)/,*.o))
# Set build vars
ifeq ($(platform), windows)
libGenDir := src
else ifeq ($(platform), macos)
libGenDir := src
endif
# Build the static library
$(coreLib): $(coreObjects)
$(call MKDIR,$(call platformpth,$(libDir)))
ar -crs $(coreLib) $(coreObjects)
# Add all rules from dependency files
-include $(coreDepends)
# Compile object files to the bin directory
$(coreBinDir)/%.o: $(coreSrcDir)/%.cpp
$(call MKDIR,$(call platformpth,$(@D)))
$(CXX) -MMD -MP -c $(compileFlags) -I $(engineDir) $< -o $@ $(CXXFLAGS)