| | |
| | | #******************************************************************************* |
| | | |
| | | PRJ_PATH=$(shell pwd) |
| | | APP_NAME = client |
| | | APP_NAME = sock_client |
| | | |
| | | BUILD_ARCH=$(shell uname -m) |
| | | ifneq ($(findstring $(BUILD_ARCH), "x86_64" "i386"),) |
| | |
| | | |
| | | # common CFLAGS for our source code |
| | | CFLAGS = -Wall -Wshadow -Wundef -Wmaybe-uninitialized -D_GNU_SOURCE |
| | | |
| | | # sub-directory need to entry and compile |
| | | SUBDIR=booster sqlite |
| | | |
| | | # sub-directory compiled to a library and need to link |
| | | SRCS=booster |
| | |
| | | CFLAGS+=-I ${PRJ_PATH}/sqlite/install/include |
| | | LDFLAGS+=-L ${PRJ_PATH}/sqlite/install/lib |
| | | LDFLAGS+=-lsqlite3 |
| | | |
| | | LDFLAGS+=-lpthread |
| | | |
| | | # sub-directory need to entry and compile |
| | | SUBDIR=${SRCS} sqlite |
| | | |
| | | all: entry subdir |
| | | ${CROSS_COMPILE}gcc ${CFLAGS} client.c -o client ${LDFLAGS} |
| | | ${CROSS_COMPILE}gcc ${CFLAGS} sock_client.c -o sock_client ${LDFLAGS} |
| | | |
| | | entry: |
| | | @echo "Building ${APP_NAME} on ${BUILD_ARCH}" |
| | | |
| | | subdir: |
| | | @for dir in ${SUBDIR} ; do if [ ! -e $${dir} ] ; then ln -s ../$${dir}; fi; done |
| | | @for dir in ${SUBDIR} ; do make -C $${dir} ; done |
| | | @for dir in ${SUBDIR} ; do make CFLAGS="${CFLAGS}" -C $${dir} ; done |
| | | |
| | | install: |
| | | cp ${APP_NAME} /tftp |