Skip to content

Commit bc72aa8

Browse files
committed
Set MMTk build type from make command line
The user can set `MMTK_BUILD` to `debug` or `release` explicitly. Otherwise, we choose based on whether the user starts a debug build or a regular build.
1 parent 6df550b commit bc72aa8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Make.inc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,18 @@ $(error MMTK_JULIA_DIR must be set to use MMTk)
718718
endif
719719
JCXXFLAGS += -DMMTK_GC
720720
JCFLAGS += -DMMTK_GC
721-
# TODO: make this "debug" as needed
722-
MMTK_BUILD_TYPE = release
721+
ifeq (${MMTK_BUILD},)
722+
ifeq (debug,$(findstring debug,$(MAKECMDGOALS)))
723+
MMTK_BUILD = debug
724+
else
725+
MMTK_BUILD = release
726+
endif
727+
endif
723728
MMTK_DIR = ${MMTK_JULIA_DIR}/mmtk
724729
MMTK_API_INC = $(MMTK_DIR)/api
725730
MMTK_JULIA_INC = ${MMTK_JULIA_DIR}/julia
726-
MMTK_LIB := -L$(MMTK_DIR)/target/$(MMTK_BUILD_TYPE) -lmmtk_julia
727-
LDFLAGS += -Wl,-rpath=$(MMTK_DIR)/target/$(MMTK_BUILD_TYPE)/
731+
MMTK_LIB := -L$(MMTK_DIR)/target/$(MMTK_BUILD) -lmmtk_julia
732+
LDFLAGS += -Wl,-rpath=$(MMTK_DIR)/target/$(MMTK_BUILD)/
728733
else
729734
MMTK_JULIA_INC :=
730735
MMTK_LIB :=

0 commit comments

Comments
 (0)