tg/Makefile.in
2015-05-17 15:58:32 -07:00

56 lines
1.7 KiB
Makefile

srcdir=@srcdir@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@
CPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@
DEFS=@DEFS@
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Werror -Wextra -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
EXTRA_LIBS=@LIBS@ @EXTRA_LIBS@ @OPENSSL_LIBS@
LOCAL_LDFLAGS=-rdynamic -ggdb -levent ${EXTRA_LIBS}
LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}
DEP=dep
AUTO=auto
EXE=bin
OBJ=objs
LIB=libs
DIR_LIST=${DEP} ${AUTO} ${EXE} ${OBJ} ${LIB} ${DEP}/auto ${OBJ}/auto
EXE_LIST=${EXE}/telegram-cli
TG_OBJECTS=${OBJ}/main.o ${OBJ}/loop.o ${OBJ}/interface.o ${OBJ}/lua-tg.o ${OBJ}/json-tg.o ${OBJ}/python-tg.o
INCLUDE=-I. -I${srcdir} -I${srcdir}/tgl
CC=@CC@
.SUFFIXES:
.SUFFIXES: .c .h .o
all: ${EXE_LIST} ${DIR_LIST}
create_dirs_and_headers: ${DIR_LIST} ${AUTO}/auto-skip.h ${AUTO}/auto-fetch.h ${AUTO}/auto-store.h ${AUTO}/auto-autocomplete.h ${AUTO}/auto-types.h
create_dirs: ${DIR_LIST}
dump-tl: ${EXE}/dump-tl-file
include ${srcdir}/Makefile.tl-parser
include ${srcdir}/Makefile.tgl
${DIR_LIST}:
@test -d $@ || mkdir -p $@
OBJ_LIST=${TG_OBJECTS} ${TGL_OBJECTS} ${TGL_COMMON_OBJECTS} ${GENERATE_OBJECTS} ${TL_PARSER_OBJECTS} ${TGL_OBJECTS_AUTO}
DEPENDENCE=$(subst ${OBJ}/,${DEP}/,$(patsubst %.o,%.d,${OBJ_LIST}))
DEPENDENCE_LIST=${DEPENDENCE}
-include ${DEPENDENCE_LIST}
${TG_OBJECTS}: ${OBJ}/%.o: ${srcdir}/%.c | create_dirs_and_headers
${CC} ${INCLUDE} ${COMPILE_FLAGS} -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<
${EXE}/telegram-cli: ${TG_OBJECTS} ${LIB}/libtgl.a
${CC} $^ ${LINK_FLAGS} -o $@
clean:
rm -rf ${DIR_LIST} config.log config.status > /dev/null || echo "all clean"