diff options
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -79,12 +79,15 @@ release: export CXXFLAGS := $(CXXFLAGS) $(COMPILE_FLAGS) $(RCOMPILE_FLAGS) | |||
79 | release: export LDFLAGS := $(LDFLAGS) $(LINK_FLAGS) $(RLINK_FLAGS) | 79 | release: export LDFLAGS := $(LDFLAGS) $(LINK_FLAGS) $(RLINK_FLAGS) |
80 | debug: export CXXFLAGS := $(CXXFLAGS) $(COMPILE_FLAGS) $(DCOMPILE_FLAGS) | 80 | debug: export CXXFLAGS := $(CXXFLAGS) $(COMPILE_FLAGS) $(DCOMPILE_FLAGS) |
81 | debug: export LDFLAGS := $(LDFLAGS) $(LINK_FLAGS) $(DLINK_FLAGS) | 81 | debug: export LDFLAGS := $(LDFLAGS) $(LINK_FLAGS) $(DLINK_FLAGS) |
82 | shared: export CXXFLAGS := $(CXXFLAGS) $(COMPILE_FLAGS) $(RCOMPILE_FLAGS) | ||
82 | 83 | ||
83 | # Build and output paths | 84 | # Build and output paths |
84 | release: export BUILD_PATH := build/release | 85 | release: export BUILD_PATH := build/release |
85 | release: export BIN_PATH := bin/release | 86 | release: export BIN_PATH := bin/release |
86 | debug: export BUILD_PATH := build/debug | 87 | debug: export BUILD_PATH := build/debug |
87 | debug: export BIN_PATH := bin/debug | 88 | debug: export BIN_PATH := bin/debug |
89 | shared: export BUILD_PATH := build/shared | ||
90 | shared: export BIN_PATH := bin/shared | ||
88 | install: export BIN_PATH := bin/release | 91 | install: 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 |
155 | release: dirs | 158 | release: dirs |
156 | ifeq ($(USE_VERSION), true) | 159 | ifeq ($(USE_VERSION), true) |
157 | @echo "Beginning release build v$(VERSION_STRING)" | 160 | @echo "Beginning release build $(VERSION_STRING)" |
158 | else | 161 | else |
159 | @echo "Beginning release build" | 162 | @echo "Beginning release build" |
160 | endif | 163 | endif |
@@ -168,7 +171,7 @@ endif | |||
168 | .PHONY: debug | 171 | .PHONY: debug |
169 | debug: dirs | 172 | debug: dirs |
170 | ifeq ($(USE_VERSION), true) | 173 | ifeq ($(USE_VERSION), true) |
171 | @echo "Beginning debug build v$(VERSION_STRING)" | 174 | @echo "Beginning debug build $(VERSION_STRING)" |
172 | else | 175 | else |
173 | @echo "Beginning debug build" | 176 | @echo "Beginning debug build" |
174 | endif | 177 | endif |
@@ -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 | ||
189 | shared: dirs | ||
190 | ifeq ($(USE_VERSION), true) | ||
191 | @echo "Beginning release build $(VERSION_STRING)" | ||
192 | else | ||
193 | @echo "Beginning release build" | ||
194 | endif | ||
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 |
183 | dirs: | 203 | dirs: |