Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #694 from andralex/makefile
Browse files Browse the repository at this point in the history
Detect OS and MODEL properly; default DMD to development ../dmd/src/dmd
  • Loading branch information
MartinNowak committed Dec 20, 2013
2 parents 3622efb + 09708af commit 4c57269
Showing 1 changed file with 41 additions and 26 deletions.
67 changes: 41 additions & 26 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,55 @@

QUIET:=@

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

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

DMD?=dmd
DMD=../dmd/src/dmd
INSTALL_DIR=../install

DOCDIR=doc
IMPDIR=import

MODEL:=default
ifneq (default,$(MODEL))
MODEL_FLAG:=-m$(MODEL)
endif
MODEL_FLAG:=-m$(MODEL)
override PIC:=$(if $(PIC),-fPIC,)

ifeq (osx,$(OS))
Expand Down

0 comments on commit 4c57269

Please sign in to comment.