Commits

Anonymous committed a4b9190

Fixed up Makefile so it is easier to digest. Added Makedefs to store Makefile
variable definitions.

Comments (0)

Files changed (2)

+# Makefile definitions for v8erl
+
+#Build environment info
+CPP := g++
+ARCH := $(shell uname -m | tr -s " ") #x86_64, x86, ppc, ...
+KERNEL := $(shell uname -s | tr -s " ") #Linux, Darwin, ...
+
+#Build environment pointers
+LIB_DIR := ./lib
+SRC_DIR := ./src
+ERL_DIR := ./erl
+EBIN_DIR := ./ebin
+
+#OS specific settings. 
+ifeq ($(KERNEL),Darwin)
+LIB_EXT = dylib
+LDFLAGS = -Wall -fPIC -dynamiclib -flat_namespace -undefined suppress
+else
+LIB_EXT = so
+LDFLAGS = -Wall -fPIC -shared -flat_namespace -undefined
+endif
+
+#Is ERL_ROOT defined?  If not we have to guess....
+ifeq (${ERL_ROOT},)
+ERL_INC += -I/usr/lib/erlang/usr/include
+ERL_INC += -I/usr/local/lib/erlang/usr/include
+ERL_INC += -I/opt/local/lib/erlang/usr/include
+
+EI_LIB += -L/usr/lib/erlang/lib/erl_interface-3.5.9/lib
+EI_LIB += -L/usr/local/lib/erlang/lib/erl_interface-3.5.9/lib
+EI_LIB += -L/opt/local/lib/erlang/lib/erl_interface-3.5.9/lib
+else
+ERL_INC = -I${ERL_ROOT}/usr/include
+EI_LIB = -L${ERL_ROOT}/lib/erl_interface-3.5.9/lib
+endif
+
+#Is V8_ROOT defined?  If not we have to guess....
+ifeq (${V8_ROOT},)
+V8_INC += -I./v8/include
+V8_INC += -I../v8/include
+
+V8_LIB += -L./v8
+V8_LIB += -L../v8
+else
+V8_LIB = -L${V8_ROOT}
+endif
-CPP := g++
-ARCH := $(shell uname -m | tr -s " ") #x86_64, x86, ppc, ...
-KERNEL := $(shell uname -s | tr -s " ") #Linux, Darwin, ...
-
-#Build environment pointers
-LIB_DIR := ./lib
-SRC_DIR := ./src
-OBJ_DIR := $(SRC_DIR)/_$(ARCH)
-ERL_DIR := ./erl
-EBIN_DIR := ./ebin
-
-#OS specific settings.  <<HERE>> This is ugly...fix?
-ifeq ($(KERNEL),Linux )
-LIB_EXT = so
-LDFLAGS = -Wall -fPIC -shared -flat_namespace -undefined
-else 
-ifeq ($(KERNEL),Darwin)
-LIB_EXT = dylib
-LDFLAGS = -Wall -fPIC -dynamiclib -flat_namespace -undefined suppress
-endif 
-$(error Makerules don't exists for $(KERNEL))
-endif
-
-#Is ERL_ROOT defined?  If not we have to guess....
-ifeq (${ERL_ROOT},)
-ERL_INC += -I/usr/lib/erlang/usr/include
-ERL_INC += -I/usr/local/lib/erlang/usr/include
-ERL_INC += -I/opt/local/lib/erlang/usr/include
-
-EI_LIB += -L/usr/lib/erlang/lib/erl_interface-3.5.9/lib
-EI_LIB += -L/usr/local/lib/erlang/lib/erl_interface-3.5.9/lib
-EI_LIB += -L/opt/local/lib/erlang/lib/erl_interface-3.5.9/lib
-else
-ERL_INC = -I${ERL_ROOT}/usr/include
-EI_LIB = -L${ERL_ROOT}/lib/erl_interface-3.5.9/lib
-endif
-
-#Is V8_ROOT defined?  If not we have to guess....
-ifeq (${V8_ROOT},)
-V8_INC += -I./v8/include
-V8_INC += -I../v8/include
-
-V8_LIB += -L./v8
-V8_LIB += -L../v8
-else
-V8_LIB = -L${V8_ROOT}
-endif
+include Makedefs
 
 #Libs to build
 LIBS = v8erl
 $(EBIN_DIR)/%.app: $(ERL_DIR)/%.app
 	cp $< $@
 
-erl: ebin
-	cd erl && make
-
 clean:    
 	rm -f src/*.o
 	rm -rf $(LIB_DIR)