Source

v8erl / Makefile

Full commit
# erlang
ERL_ROOT = /opt/local/lib/erlang
ERL_INC  = $(ERL_ROOT)/usr/include
# v8
V8_ROOT  = ../v8
V8_INC   = $(V8_ROOT)/include
# compile
CPP      = g++
CFLAGS   = -Iinclude -I$(V8_INC) -I$(ERL_INC) -g -c -Wall
LFLAGS   = -dynamiclib -flat_namespace -undefined suppress -L$(V8_ROOT) -lv8_g -Wall -fPIC
CPPSRCS  = $(wildcard src/*.cc)
CPPOBJS  = $(patsubst %.cc,%.o,$(CPPSRCS))

all: $(CPPOBJS) libv8erl.dylib

%.o: %.cc
	$(CPP) $(CFLAGS) -o $@ $<


%.dylib: $(CPPOBJS)
	$(CPP) $(LFLAGS) -o $@ $(CPPOBJS)

.PHONY: clean

clean:
	-rm $(CPPOBJS) libv8erl.dylib