Skip to content

Commit

Permalink
OS/MODEL detection again...
Browse files Browse the repository at this point in the history
  • Loading branch information
andralex committed Dec 28, 2013
1 parent e2faeba commit 385f995
Showing 1 changed file with 41 additions and 28 deletions.
69 changes: 41 additions & 28 deletions posix.mak
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
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)

WITH_DOC = no
DOC = ../dlang.org/web
ROOT_OF_THEM_ALL = generated
ROOT = $(ROOT_OF_THEM_ALL)/$(OS)/$(MODEL)

Expand Down

0 comments on commit 385f995

Please sign in to comment.