1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#-Wextra  -pedantic -Wno-unused-parameter -Wall -Wextra -ansi
CFLAGS =  -std=c++14 -O3 -Wall -DNDEBUG
EXEC = test

LIBS = `xml2-config --libs`
INC = `xml2-config --cflags`  -I../include
CPP_FILES := $(wildcard ../src/*.cc)
OBJ_FILES := $(addprefix ../obj/,$(notdir $(CPP_FILES:.cc=.o)))

all: main.cc $(OBJ_FILES)
	$(CXX)  $(CFLAGS) $(INC) -o $(EXEC) $^ $(LIBS)

../obj/%.o: ../src/%.cc
	@mkdir -p ../obj
	$(CXX) $(CFLAGS) $(INC) -c -o $@ $<

lib: $(OBJ_FILES) 
	@mkdir -p ../lib
	@ar rcsv ../lib/libparserxcsp3core.a $(OBJ_FILES)

testlib: main.cc
	$(CXX)  $(CFLAGS) $(INC) -o testlib main.cc -L ../lib $(LIBS) -lparserxcsp3core

testTree: testTree.cc
	$(CXX)  $(CFLAGS) $(INC) -o testTree testTree.cc -L ../lib $(LIBS) -lparserxcsp3core

testCanonization: testCanonization.cc $(OBJ_FILES)
	$(CXX)  $(CFLAGS) $(INC) -o testCanonization testCanonization.cc -L ../lib $(LIBS) -lparserxcsp3core

clean:
	rm -rf ../obj/*.o test ../lib/* testlib