Add a proper build system
FossilOrigin-Name: 8679c61b2c82da9daa316ed5eb90ba1b69e608127afa318cbdbff56b53d65a74
This commit is contained in:
parent
71342537cf
commit
35212e3305
28 changed files with 5118 additions and 76 deletions
63
Makefile
63
Makefile
|
@ -1,62 +1,3 @@
|
|||
LIB = objpgsql
|
||||
LIB_MAJOR = 0
|
||||
LIB_MINOR = 0
|
||||
SUBDIRS = src
|
||||
|
||||
SRCS = PGConnection.m \
|
||||
PGResult.m \
|
||||
PGResultRow.m \
|
||||
exceptions/PGCommandFailedException.m \
|
||||
exceptions/PGConnectionFailedException.m \
|
||||
exceptions/PGException.m
|
||||
|
||||
HEADERS = ${SRCS:.m=.h} \
|
||||
ObjPgSQL.h
|
||||
|
||||
CPPFLAGS += -Iexceptions -I.
|
||||
OBJCFLAGS += -Werror
|
||||
LIBS += -lpq
|
||||
|
||||
prefix ?= /usr/local
|
||||
|
||||
INSTALL ?= install
|
||||
OBJFW_CONFIG ?= objfw-config
|
||||
OBJFW_COMPILE ?= objfw-compile
|
||||
|
||||
LIB_PREFIX = `${OBJFW_CONFIG} --lib-prefix`
|
||||
LIB_SUFFIX = `${OBJFW_CONFIG} --lib-suffix`
|
||||
LIB_FILE = ${LIB_PREFIX}${LIB}${LIB_SUFFIX}
|
||||
|
||||
all:
|
||||
@objfw-compile \
|
||||
--lib ${LIB_MAJOR}.${LIB_MINOR} \
|
||||
-o objpgsql \
|
||||
--builddir build \
|
||||
${CPPFLAGS} \
|
||||
${OBJCFLAGS} \
|
||||
${LIBS} \
|
||||
${SRCS}
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
@objfw-compile \
|
||||
-o test \
|
||||
--builddir build \
|
||||
-L. \
|
||||
-lobjpgsql \
|
||||
${CPPFLAGS} \
|
||||
test.m
|
||||
|
||||
clean:
|
||||
rm -f test libobjpgsql.* exceptions/*~ *~
|
||||
rm -fr build
|
||||
|
||||
install:
|
||||
mkdir -p ${destdir}${prefix}/include/ObjPgSQL
|
||||
for i in ${HEADERS}; do \
|
||||
${INSTALL} -m 644 $$i \
|
||||
${destdir}${prefix}/include/ObjPgSQL/$$(basename $$i); \
|
||||
done
|
||||
mkdir -p ${destdir}${prefix}/lib
|
||||
export LIB_MAJOR=${LIB_MAJOR}; \
|
||||
export LIB_MINOR=${LIB_MINOR}; \
|
||||
${INSTALL} -m 755 ${LIB_FILE} ${destdir}${prefix}/lib/${LIB_FILE}
|
||||
include buildsys.mk
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue