2011-06-08 11:29:22 +04:00
|
|
|
CC=cc
|
|
|
|
CXX=c++
|
2011-06-07 12:17:19 +04:00
|
|
|
INCLUDE=-I$(HOME)/projects/include
|
|
|
|
KOLAN_PROJECTS=$(HOME)/projects
|
|
|
|
KOLAN_INCLUDE=$(KOLAN_PROJECTS)/include
|
|
|
|
|
|
|
|
# Compiler flags
|
|
|
|
# if mode variable is empty, setting debug build mode
|
|
|
|
ifeq ($(mode),)
|
|
|
|
mode = debug
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),debug)
|
2011-06-08 15:13:26 +04:00
|
|
|
CFLAGS = -O0 -g -std=c++0x -pedantic -Wextra -Wconversion
|
2011-06-07 12:17:19 +04:00
|
|
|
LDFLAGS =
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),profile)
|
|
|
|
CFLAGS = -O0 -g -p -ftest-coverage -Wcoverage-mismatch
|
|
|
|
LDFLAGS = -g -p
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),develop)
|
|
|
|
CFLAGS += -O2 -g
|
|
|
|
LDFLAGS += -O1
|
|
|
|
endif
|
|
|
|
ifeq ($(mode),release)
|
|
|
|
CFLAGS += -O2
|
|
|
|
LDFLAGS += -O1
|
|
|
|
endif
|
|
|
|
|
|
|
|
CFLAGS += -Wall $(shell pkg-config --cflags liblist)
|
|
|
|
LDFLAGS += -Wall $(shell pkg-config --libs liblist) -lpthread -lexpat
|
|
|
|
|
|
|
|
all: tex_table_class_test
|
|
|
|
|
|
|
|
ifneq ($(mode),debug)
|
|
|
|
ifneq ($(mode),profile)
|
|
|
|
ifneq ($(mode),develop)
|
|
|
|
ifneq ($(mode),release)
|
|
|
|
@echo "Invalid build mode."
|
|
|
|
@echo "Please use 'make mode=release' or 'make mode=develop' or 'make mode=debug'"
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
@echo ".........................."
|
|
|
|
@echo "Building on "$(mode)" mode "
|
|
|
|
@echo "CFLAGS=$(CFLAGS)"
|
|
|
|
@echo "LDLAGS=$(LDFLAGS)"
|
|
|
|
@echo ".........................."
|
|
|
|
|
|
|
|
%.o :
|
2011-06-07 19:08:15 +04:00
|
|
|
$(CXX) -c $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $<
|
2011-06-07 12:17:19 +04:00
|
|
|
|
2011-06-08 15:13:26 +04:00
|
|
|
tex_table_class_test_obj = tex_table_class_test.o tex_table_class.o xmalloc.o xerror.o
|
|
|
|
tex_table_class_test: $(tex_table_class_test_obj)
|
|
|
|
$(CXX) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $(tex_table_class_test_obj)
|
2011-06-07 12:17:19 +04:00
|
|
|
|
2011-06-08 15:13:26 +04:00
|
|
|
tex_table_class_test.o: tex_table_class_test.cpp tex_table_class.o
|
|
|
|
|
|
|
|
tex_table_class.o: tex_table_class.[c,h]pp xmalloc.o
|
2011-06-07 12:17:19 +04:00
|
|
|
|
|
|
|
xmalloc.o: $(KOLAN_INCLUDE)/xmalloc.[c,h] xerror.o
|
|
|
|
|
|
|
|
xerror.o: $(KOLAN_INCLUDE)/xerror.[c,h]
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) *.o *.out callgrind.out.* *.gcno tex_table_class_test
|
|
|
|
|
|
|
|
.PHONY: all clean
|