2012-01-28 17:24:19 +00:00
|
|
|
BUILDMODE = debug
|
|
|
|
BUILDPATH = ../build/${BUILDMODE}
|
|
|
|
OBJPATH = ./obj/${BUILDMODE}
|
|
|
|
SOURCES = $(wildcard *.c)
|
|
|
|
OBJECTS = ${SOURCES:%.c=${OBJPATH}/%.o}
|
|
|
|
HEADERS = $(wildcard shared/*.h *.h)
|
|
|
|
RESULT = ${BUILDPATH}/libpaysages.so
|
|
|
|
CC_FLAGS = -Wall -fPIC $(shell pkg-config --cflags glib-2.0 gthread-2.0)
|
|
|
|
CC_LDFLAGS = $(shell pkg-config --libs glib-2.0 gthread-2.0) -lIL -lILU
|
2011-12-23 22:00:19 +00:00
|
|
|
|
2012-01-28 17:24:19 +00:00
|
|
|
ifeq ($(BUILDMODE),debug)
|
2012-04-09 19:58:08 +00:00
|
|
|
CC_FLAGS += -g -pg
|
|
|
|
CC_LDFLAGS += -g -pg
|
2012-01-28 17:24:19 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(BUILDMODE),release)
|
2012-04-09 19:58:08 +00:00
|
|
|
CC_FLAGS += -O3 -DNDEBUG
|
2012-01-28 17:24:19 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
all:prepare ${RESULT}
|
|
|
|
|
|
|
|
prepare:
|
|
|
|
mkdir -p ${OBJPATH}
|
|
|
|
mkdir -p ${BUILDPATH}
|
2011-12-23 22:00:19 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f ${OBJECTS}
|
|
|
|
rm -f ${RESULT}
|
|
|
|
|
2012-01-28 17:24:19 +00:00
|
|
|
${OBJPATH}/%.o:%.c ${HEADERS}
|
2011-12-23 22:00:19 +00:00
|
|
|
${CC} -c ${CC_FLAGS} $< -o $@
|
|
|
|
|
|
|
|
${RESULT}:${OBJECTS}
|
2011-12-23 22:39:13 +00:00
|
|
|
${CC} $^ -shared ${CC_LDFLAGS} -o $@
|
2011-12-23 22:00:19 +00:00
|
|
|
|
2012-01-28 17:24:19 +00:00
|
|
|
.PHONY:all clean prepare
|
2011-12-23 22:00:19 +00:00
|
|
|
|