CXX      ?= g++
AR       ?= ar
ECPPC    ?= ecppc

CXXFLAGS ?= -O2 -Woverloaded-virtual -Wall -fPIC

CXXFLAGS += `tntnet-config --cxxflags`
LDFLAGS  += `tntnet-config --libs`

INCLUDES += -I.. -I../pagelib -I$(VDRDIR)/include

### The directory environment:

VDRDIR   ?= ../../../..

### The object files (add further files here):

OBJS	= alphaAPI.o  domLib.o  domTT_drag.o  domTT.o  fadomatic.o

### Default rules:

.PHONY: all clean

all: libjavascript.a

### Implicit rules:

%.o: %.cpp
	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<

%.cpp: %.js
	$(ECPPC) $(ECPPFLAGS) $(ECPPFLAGS_JS) -b -m "test/javascript" $<

### Targets:

libjavascript.a: $(OBJS)
	$(AR) r $@ $^

clean:
	@rm -f *~ *.o core* libjavascript.a $(OBJS:%.o=%.cpp)
