aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile24
1 files changed, 22 insertions, 2 deletions
diff --git a/makefile b/makefile
index 0c29230..70d6c97 100644
--- a/makefile
+++ b/makefile
@@ -79,12 +79,15 @@ release: export CXXFLAGS := $(CXXFLAGS) $(COMPILE_FLAGS) $(RCOMPILE_FLAGS)
79release: export LDFLAGS := $(LDFLAGS) $(LINK_FLAGS) $(RLINK_FLAGS) 79release: export LDFLAGS := $(LDFLAGS) $(LINK_FLAGS) $(RLINK_FLAGS)
80debug: export CXXFLAGS := $(CXXFLAGS) $(COMPILE_FLAGS) $(DCOMPILE_FLAGS) 80debug: export CXXFLAGS := $(CXXFLAGS) $(COMPILE_FLAGS) $(DCOMPILE_FLAGS)
81debug: export LDFLAGS := $(LDFLAGS) $(LINK_FLAGS) $(DLINK_FLAGS) 81debug: export LDFLAGS := $(LDFLAGS) $(LINK_FLAGS) $(DLINK_FLAGS)
82shared: export CXXFLAGS := $(CXXFLAGS) $(COMPILE_FLAGS) $(RCOMPILE_FLAGS)
82 83
83# Build and output paths 84# Build and output paths
84release: export BUILD_PATH := build/release 85release: export BUILD_PATH := build/release
85release: export BIN_PATH := bin/release 86release: export BIN_PATH := bin/release
86debug: export BUILD_PATH := build/debug 87debug: export BUILD_PATH := build/debug
87debug: export BIN_PATH := bin/debug 88debug: export BIN_PATH := bin/debug
89shared: export BUILD_PATH := build/shared
90shared: export BIN_PATH := bin/shared
88install: export BIN_PATH := bin/release 91install: export BIN_PATH := bin/release
89 92
90# Find all source files in the source directory, sorted by most 93# Find all source files in the source directory, sorted by most
@@ -154,7 +157,7 @@ endif
154.PHONY: release 157.PHONY: release
155release: dirs 158release: dirs
156ifeq ($(USE_VERSION), true) 159ifeq ($(USE_VERSION), true)
157 @echo "Beginning release build v$(VERSION_STRING)" 160 @echo "Beginning release build $(VERSION_STRING)"
158else 161else
159 @echo "Beginning release build" 162 @echo "Beginning release build"
160endif 163endif
@@ -168,7 +171,7 @@ endif
168.PHONY: debug 171.PHONY: debug
169debug: dirs 172debug: dirs
170ifeq ($(USE_VERSION), true) 173ifeq ($(USE_VERSION), true)
171 @echo "Beginning debug build v$(VERSION_STRING)" 174 @echo "Beginning debug build $(VERSION_STRING)"
172else 175else
173 @echo "Beginning debug build" 176 @echo "Beginning debug build"
174endif 177endif
@@ -178,6 +181,23 @@ endif
178 @echo -n "Total build time: " 181 @echo -n "Total build time: "
179 @$(END_TIME) 182 @$(END_TIME)
180 183
184$(BUILD_PATH)/moonp.so: src/MoonP/ast.cpp src/MoonP/moon_compiler.cpp src/MoonP/moon_parser.cpp src/MoonP/moonplus.cpp src/MoonP/parser.cpp
185 $(CMD_PREFIX)$(CXX) $(CXXFLAGS) -I $(SRC_PATH) -I $(LUAI) -L $(LUAL) -llua -o $@ -fPIC -shared $?
186
187# Standard, non-optimized release build
188.PHONY: shared
189shared: dirs
190ifeq ($(USE_VERSION), true)
191 @echo "Beginning release build $(VERSION_STRING)"
192else
193 @echo "Beginning release build"
194endif
195 @$(START_TIME)
196 @$(MAKE) $(BUILD_PATH)/moonp.so --no-print-directory
197 @echo -n "Total build time: "
198 @$(END_TIME)
199 @mv $(BUILD_PATH)/moonp.so $(BIN_PATH)/moonp.so
200
181# Create the directories used in the build 201# Create the directories used in the build
182.PHONY: dirs 202.PHONY: dirs
183dirs: 203dirs: