Makefile.tgl 3.08 KB
Newer Older
V V's avatar
V V committed
1
TGL_OBJECTS=${OBJ}/mtproto-common.o ${OBJ}/mtproto-client.o ${OBJ}/mtproto-key.o ${OBJ}/queries.o ${OBJ}/structures.o ${OBJ}/binlog.o ${OBJ}/tgl.o ${OBJ}/updates.o ${OBJ}/tgl-net.o ${OBJ}/tgl-timers.o ${OBJ}/tg-mime-types.o ${OBJ}/mtproto-utils.o  ${OBJ}/crypto/bn_openssl.o ${OBJ}/crypto/bn_altern.o ${OBJ}/crypto/rsa_pem_openssl.o ${OBJ}/crypto/rsa_pem_altern.o ${OBJ}/crypto/md5_openssl.o ${OBJ}/crypto/md5_altern.o ${OBJ}/crypto/sha_openssl.o ${OBJ}/crypto/sha_altern.o ${OBJ}/crypto/aes_openssl.o ${OBJ}/crypto/aes_altern.o 
vvaltman's avatar
vvaltman committed
2

vvaltman's avatar
vvaltman committed
3
TGL_OBJECTS_AUTO=${OBJ}/auto/auto-skip.o ${OBJ}/auto/auto-fetch.o ${OBJ}/auto/auto-store.o ${OBJ}/auto/auto-autocomplete.o ${OBJ}/auto/auto-types.o ${OBJ}/auto/auto-fetch-ds.o  ${OBJ}/auto/auto-free-ds.o ${OBJ}/auto/auto-store-ds.o ${OBJ}/auto/auto-print-ds.o
vvaltman's avatar
vvaltman committed
4 5


Vysheng's avatar
Vysheng committed
6 7
TLD_OBJECTS=${OBJ}/dump-tl-file.o
GENERATE_OBJECTS=${OBJ}/generate.o
V V's avatar
V V committed
8
TGL_COMMON_OBJECTS=${OBJ}/tools.o ${OBJ}/crypto/rand_openssl.o ${OBJ}/crypto/rand_altern.o ${OBJ}/crypto/err_openssl.o ${OBJ}/crypto/err_altern.o
Vysheng's avatar
Vysheng committed
9 10 11 12 13 14 15 16
TGL_OBJ_C=${GENERATE_OBJECTS} ${TGL_COMMON_OBJECTS} ${TGL_OBJECTS} ${TLD_OBJECTS}

.SUFFIXES:

.SUFFIXES: .c .h .o

dump-tl: ${EXE}/dump-tl-file

vvaltman's avatar
vvaltman committed
17
${TGL_OBJECTS}: ${AUTO}/constants.h ${AUTO}/auto-skip.h ${AUTO}/auto-fetch.h ${AUTO}/auto-store.h ${AUTO}/auto-autocomplete.h ${AUTO}/auto-types.h ${AUTO}/auto-fetch-ds.h ${AUTO}/auto-free-ds.h ${AUTO}/auto-store-ds.h ${AUTO}/auto-print-ds.h
Vysheng's avatar
Vysheng committed
18 19 20 21

${TGL_OBJ_C}: ${OBJ}/%.o: ${srcdir}/tgl/%.c | create_dirs
	${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tgl -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<

vvaltman's avatar
vvaltman committed
22 23 24 25 26
${TGL_OBJECTS_AUTO}: ${OBJ}/auto/%.o: ${AUTO}/%.c | create_dirs
	${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tgl -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<

#${OBJ}/auto/auto.o: ${AUTO}/auto.c
#	${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tgl -c -MP -MD -MF ${DEP}/auto/auto.d -MQ ${OBJ}/auto/auto.o -o $@ $<
Vysheng's avatar
Vysheng committed
27

vvaltman's avatar
vvaltman committed
28
${LIB}/libtgl.a: ${TGL_OBJECTS} ${TGL_COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
vvaltman's avatar
vvaltman committed
29
	rm -f $@ && ar ruv $@ $^
Vysheng's avatar
Vysheng committed
30 31 32 33 34 35 36

${EXE}/generate: ${GENERATE_OBJECTS} ${TGL_COMMON_OBJECTS}
	${CC} ${GENERATE_OBJECTS} ${TGL_COMMON_OBJECTS} ${LINK_FLAGS} -o $@

${AUTO}/scheme.tlo: ${AUTO}/scheme.tl ${EXE}/tl-parser
	${EXE}/tl-parser -e $@ ${AUTO}/scheme.tl

vvaltman's avatar
vvaltman committed
37
${AUTO}/scheme.tl: ${srcdir}/tgl/scheme.tl ${srcdir}/tgl/encrypted_scheme.tl ${srcdir}/tgl/binlog.tl ${srcdir}/tgl/append.tl ${srcdir}/tgl/mtproto.tl | ${AUTO}
Vysheng's avatar
Vysheng committed
38 39 40 41 42
	cat $^ > $@

${AUTO}/scheme2.tl: ${AUTO}/scheme.tl ${EXE}/tl-parser
	${EXE}/tl-parser -E ${AUTO}/scheme.tl 2> $@  || ( cat $@ && rm $@ && false )

vvaltman's avatar
vvaltman committed
43
${AUTO}/auto-%.c: ${AUTO}/scheme.tlo ${EXE}/generate auto/constants.h ${AUTO}/auto-%.h | create_dirs_and_headers
V V's avatar
V V committed
44
	${EXE}/generate -g $(patsubst ${AUTO}/auto-%.c,%,$@) ${AUTO}/scheme.tlo > $@ || ( rm $@ && false )
Vysheng's avatar
Vysheng committed
45

vvaltman's avatar
vvaltman committed
46
${AUTO}/auto-%.h: ${AUTO}/scheme.tlo ${EXE}/generate
V V's avatar
V V committed
47
	${EXE}/generate -g $(patsubst ${AUTO}/auto-%.h,%-header,$@) ${AUTO}/scheme.tlo > $@  || ( rm $@ && false )
Vysheng's avatar
Vysheng committed
48 49 50 51 52 53 54

${AUTO}/constants.h: ${AUTO}/scheme2.tl ${srcdir}/tgl/gen_constants_h.awk
	awk -f ${srcdir}/tgl/gen_constants_h.awk < $< > $@

${EXE}/dump-tl-file: ${OBJ}/auto/auto.o ${TLD_OBJECTS}
	${CC} ${OBJ}/auto/auto.o ${TLD_OBJECTS} ${LINK_FLAGS} -o $@