Skip to content

Commit

Permalink
Merge pull request #101 from andralex/rdmd
Browse files Browse the repository at this point in the history
OS/MODEL detection again...
  • Loading branch information
MartinNowak committed Dec 28, 2013
2 parents e2faeba + 385f995 commit f0606e3
Showing 1 changed file with 39 additions and 28 deletions.
67 changes: 39 additions & 28 deletions posix.mak
@@ -1,39 +1,50 @@
DMD ?= dmd
CC ?= gcc
DMD = ../dmd/src/dmd
CC = gcc
INSTALL_DIR = ../install

WITH_DOC ?= no
DOC ?= ../dlang.org/web
WITH_DOC = no
DOC = ../dlang.org/web

OS:=
uname_S:=$(shell uname -s)
ifeq (Darwin,$(uname_S))
OS:=osx
endif
ifeq (Linux,$(uname_S))
OS:=linux
endif
ifeq (FreeBSD,$(uname_S))
OS:=freebsd
endif
ifeq (OpenBSD,$(uname_S))
OS:=openbsd
endif
ifeq (Solaris,$(uname_S))
OS:=solaris
endif
ifeq (SunOS,$(uname_S))
OS:=solaris
endif
ifeq (,$(OS))
$(error Unrecognized or unsupported OS for uname: $(uname_S))
uname_S:=$(shell uname -s)
ifeq (Darwin,$(uname_S))
OS=osx
endif
ifeq (Linux,$(uname_S))
OS=linux
endif
ifeq (FreeBSD,$(uname_S))
OS=freebsd
endif
ifeq (OpenBSD,$(uname_S))
OS=openbsd
endif
ifeq (Solaris,$(uname_S))
OS=solaris
endif
ifeq (SunOS,$(uname_S))
OS=solaris
endif
ifeq (,$(OS))
$(error Unrecognized or unsupported OS for uname: $(uname_S))
endif
endif

MODEL:=default
ifneq (default,$(MODEL))
MODEL_FLAG:=-m$(MODEL)
ifeq (,$(MODEL))
uname_M:=$(shell uname -m)
ifeq (x86_64,$(uname_M))
MODEL=64
else
ifeq (i686,$(uname_M))
MODEL=32
else
$(error Cannot figure 32/64 model from uname -m: $(uname_M))
endif
endif
endif

MODEL_FLAG=-m$(MODEL)

ROOT_OF_THEM_ALL = generated
ROOT = $(ROOT_OF_THEM_ALL)/$(OS)/$(MODEL)

Expand Down

0 comments on commit f0606e3

Please sign in to comment.