https://github.com/crillab/nacre_mini
Tip revision: 9973673b2f9220ca6480180cd82d34ea4cca8718 authored by Gaël Glorian on 05 June 2018, 08:40:41 UTC
Makefile updated to compile lib by default
Makefile updated to compile lib by default
Tip revision: 9973673
makefile
#-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
