Skip to content

Commit

Permalink
Makefile: use same logic for OS and MODEL for test as druntime/phobos…
Browse files Browse the repository at this point in the history
…/dmd
  • Loading branch information
lionello committed May 28, 2015
1 parent b59c509 commit 687b047
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 41 deletions.
1 change: 1 addition & 0 deletions src/osmodel.mak
@@ -1,4 +1,5 @@
# This Makefile snippet detects the OS and the architecture MODEL
# Keep this file in sync between druntime, phobos, and dmd repositories!

ifeq (,$(OS))
uname_S:=$(shell uname -s)
Expand Down
46 changes: 5 additions & 41 deletions test/Makefile
Expand Up @@ -59,44 +59,8 @@
# considered to be enabled).
# default: (none, enabled)

ifeq (,$(OS))
OS:=$(shell uname)
ifeq (Darwin,$(OS))
OS:=osx
else
ifeq (Linux,$(OS))
OS:=linux
else
ifeq (FreeBSD,$(OS))
OS:=freebsd
else
ifeq (Solaris,$(OS))
OS:=solaris
else
ifeq (SunOS,$(OS))
OS:=solaris
else
$(error Unrecognized or unsupported OS for uname: $(OS))
endif
endif
endif
endif
endif
else
ifeq (Windows_NT,$(OS))
ifeq ($(findstring WOW64, $(shell uname)),WOW64)
OS:=win64
else
OS:=win32
endif
endif
ifeq (Win_32,$(OS))
OS:=win32
endif
ifeq (Win_64,$(OS))
OS:=win64
endif
endif
include ../src/osmodel.mak

export OS

ifeq (freebsd,$(OS))
Expand All @@ -106,7 +70,7 @@ else
endif
QUIET=@
export RESULTS_DIR=test_results
export MODEL=32
export MODEL
export REQUIRED_ARGS=

ifeq ($(findstring win,$(OS)),win)
Expand Down Expand Up @@ -238,6 +202,6 @@ start_fail_compilation_tests: $(RESULTS_DIR)/.created $(RESULTS_DIR)/d_do_test$(
$(RESULTS_DIR)/d_do_test$(EXE): d_do_test.d $(RESULTS_DIR)/.created
@echo "Building d_do_test tool"
@echo "OS: $(OS)"
$(QUIET)$(DMD) -conf= -m$(MODEL) -unittest -run d_do_test.d -unittest
$(QUIET)$(DMD) -conf= -m$(MODEL) -od$(RESULTS_DIR) -of$(RESULTS_DIR)$(DSEP)d_do_test$(EXE) d_do_test.d
$(QUIET)$(DMD) -conf= $(MODEL_FLAG) -unittest -run d_do_test.d -unittest
$(QUIET)$(DMD) -conf= $(MODEL_FLAG) -od$(RESULTS_DIR) -of$(RESULTS_DIR)$(DSEP)d_do_test$(EXE) d_do_test.d

0 comments on commit 687b047

Please sign in to comment.