Permalink
Browse files

Merge branch 'master' of github.com:tonyrog/cl

  • Loading branch information...
2 parents 4d7601c + a4b62f6 commit bba7b77aeecaaf1b53e3df2e1f6846dd3ad829c4 @tonyrog committed Mar 2, 2012
Showing with 141 additions and 99 deletions.
  1. +1 −1 .gitignore
  2. +27 −11 c_src/Makefile
  3. +97 −81 c_src/cl_nif.c
  4. +1 −1 src/cl.erl
  5. +15 −5 src/clu.erl
View
@@ -14,7 +14,7 @@ TAGS
# c_src
/c_src/autom4te.cache
-/c_src/config.*
+#/c_src/config.* config.build.in
/c_src/configure
# Derivates
View
@@ -11,6 +11,11 @@ ERLDIR := $(shell erl -noshell -eval "io:format([126,115,126,110],[code:root_dir
ERL_C_INCLUDE_DIR := $(ERLDIR)/usr/include
OCL_DIR := $(shell cd ..; pwd)
+## Windows start
+ifneq (, $(findstring MINGW32,$(OSNAME)))
+MINGW = Yes
+endif
+
MAC_OS_X = No
WIN32_GCC = No
WIN32_CL = No
@@ -24,17 +29,32 @@ SSE3 = No
SSE4 = No
EXT = so
+ifneq ($(MINGW), Yes)
+CONFIG_FILE_64 = config.64.build
+CONFIG_FILE_32 = config.32.build
ifeq ($(WORDSIZE), 64)
-include config.64.build
+include $(CONFIG_FILE_64)
endif
ifeq ($(WORDSIZE), 32)
-include config.32.build
+include $(CONFIG_FILE_32)
+endif
+else
+# Skip configure on windows for now we don't have
+# 64bits support anyway, autoconf and lib are a mess
+# to install
+ifeq ($(WORDSIZE), 64)
+ CL_BUILD=false
+else
+ CL_BUILD=true
endif
+endif
+
+
ifeq ($(TYPE), debug)
OBJDIR=../obj/debug
LIBDIR=../lib/debug
-CFLAGS += -Ddebug -DDEBUG -g -Wall -Wextra -Wswitch-default -Wswitch-enum -D_THREAD_SAFE
+CFLAGS += -Ddebug -DDEBUG -g -Wall -Wextra -Wswitch-default -Wswitch-enum -D_THREAD_SAFE
CFLAGS += -D_REENTRANT -fno-common -I$(ERL_C_INCLUDE_DIR)
WIN_DEBUG = -Ddebug -DDEBUG
endif
@@ -55,7 +75,8 @@ endif
ifeq ($(WORDSIZE), 64)
CFLAGS += -O3 -fPIC -m64 -DWORDSIZE=64
endif
-LD_SHARED := $(CC) -shared -lOpenCL
+LD_SHARED := $(CC) -shared
+LDFLAGS += -lOpenCL
endif
ifeq ($(OSNAME), Darwin)
@@ -70,11 +91,6 @@ LD_SHARED := $(CC) -m64 -bundle -flat_namespace -undefined suppress
endif
endif
-## Windows start
-ifneq (, $(findstring MINGW32,$(OSNAME)))
-MINGW = Yes
-endif
-
ifeq ($(MINGW), Yes)
EXT = dll
@@ -185,11 +201,11 @@ OCL_SIMD_OBJS = $(SIMD_OBJS:%=$(OBJDIR)/%)
all: all32 all64
-all32: config.32.build
+all32: $(CONFIG_FILE_32)
$(MAKE) nif TYPE=release WORDSIZE=32
$(MAKE) nif TYPE=debug WORDSIZE=32
-all64: config.64.build
+all64: $(CONFIG_FILE_64)
$(MAKE) nif TYPE=release WORDSIZE=64
$(MAKE) nif TYPE=debug WORDSIZE=64
Oops, something went wrong.

0 comments on commit bba7b77

Please sign in to comment.