Permalink
Browse files

build: rename OS to PLATFORM

Rename the OS make variable to PLATFORM, it conflicts with the OS env
var. That is, running `make` when the OS env var is set, may cause
spurious build breakage.

Fixes #737.
  • Loading branch information...
1 parent b45a74f commit a9740c9bc432fe0b416c4c765a6011ddc2df966f @bnoordhuis bnoordhuis committed Mar 16, 2013
Showing with 13 additions and 13 deletions.
  1. +3 −3 build.mk
  2. +10 −10 config-unix.mk
View
@@ -18,17 +18,17 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-OS ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
+PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
CPPFLAGS += -I$(SRCDIR)/include -I$(SRCDIR)/include/uv-private
-ifeq (darwin,$(OS))
+ifeq (darwin,$(PLATFORM))
SOEXT = dylib
else
SOEXT = so
endif
-ifneq (,$(findstring mingw,$(OS)))
+ifneq (,$(findstring mingw,$(PLATFORM)))
include $(SRCDIR)/config-mingw.mk
else
include $(SRCDIR)/config-unix.mk
View
@@ -54,21 +54,21 @@ OBJS += src/fs-poll.o
OBJS += src/uv-common.o
OBJS += src/inet.o
-ifeq (sunos,$(OS))
+ifeq (sunos,$(PLATFORM))
CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
LDFLAGS+=-lkstat -lnsl -lsendfile -lsocket
# Library dependencies are not transitive.
RUNNER_LDFLAGS += $(LDFLAGS)
OBJS += src/unix/sunos.o
endif
-ifeq (aix,$(OS))
+ifeq (aix,$(PLATFORM))
CPPFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500
LDFLAGS+= -lperfstat
OBJS += src/unix/aix.o
endif
-ifeq (darwin,$(OS))
+ifeq (darwin,$(PLATFORM))
CPPFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
LDFLAGS += -framework Foundation \
-framework CoreServices \
@@ -82,7 +82,7 @@ OBJS += src/unix/proctitle.o
OBJS += src/unix/darwin-proctitle.o
endif
-ifeq (linux,$(OS))
+ifeq (linux,$(PLATFORM))
CSTDFLAG += -D_GNU_SOURCE
LDFLAGS+=-ldl -lrt
RUNNER_CFLAGS += -D_GNU_SOURCE
@@ -92,38 +92,38 @@ OBJS += src/unix/linux-core.o \
src/unix/proctitle.o
endif
-ifeq (freebsd,$(OS))
+ifeq (freebsd,$(PLATFORM))
LDFLAGS+=-lkvm
OBJS += src/unix/freebsd.o
OBJS += src/unix/kqueue.o
endif
-ifeq (dragonfly,$(OS))
+ifeq (dragonfly,$(PLATFORM))
LDFLAGS+=-lkvm
OBJS += src/unix/freebsd.o
OBJS += src/unix/kqueue.o
endif
-ifeq (netbsd,$(OS))
+ifeq (netbsd,$(PLATFORM))
LDFLAGS+=-lkvm
OBJS += src/unix/netbsd.o
OBJS += src/unix/kqueue.o
endif
-ifeq (openbsd,$(OS))
+ifeq (openbsd,$(PLATFORM))
LDFLAGS+=-lkvm
OBJS += src/unix/openbsd.o
OBJS += src/unix/kqueue.o
endif
-ifneq (,$(findstring cygwin,$(OS)))
+ifneq (,$(findstring cygwin,$(PLATFORM)))
# We drop the --std=c89, it hides CLOCK_MONOTONIC on cygwin
CSTDFLAG = -D_GNU_SOURCE
LDFLAGS+=
OBJS += src/unix/cygwin.o
endif
-ifeq (sunos,$(OS))
+ifeq (sunos,$(PLATFORM))
RUNNER_LDFLAGS += -pthreads
else
RUNNER_LDFLAGS += -pthread

0 comments on commit a9740c9

Please sign in to comment.