Skip to content

Commit

Permalink
tgl: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Vysheng committed Nov 12, 2014
1 parent 2a72b77 commit 859829d
Show file tree
Hide file tree
Showing 51 changed files with 25,370 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Makefile
autom4te.cache
config.h
config.log
config.status
.idea/
nbproject/
bin/
objs/
dep/
auto/
libs/
83 changes: 83 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
srcdir=@srcdir@

CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@
CPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@
DEFS=@DEFS@
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Werror -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=${srcdir}/dep
AUTO=${srcdir}/auto
OBJ=${srcdir}/objs
LIB=${srcdir}/libs
DIR_LIST=${DEP} ${AUTO} ${EXE} ${OBJ} ${LIB} ${DEP}/auto ${OBJ}/auto

LIB_LIST=${LIB}/libtgl.a

TGL_OBJECTS=${OBJ}/mtproto-common.o ${OBJ}/mtproto-client.o ${OBJ}/queries.o ${OBJ}/structures.o ${OBJ}/binlog.o ${OBJ}/auto/auto.o ${OBJ}/tgl.o ${OBJ}/updates.o
TLD_OBJECTS=${OBJ}/dump-tl-file.o
GENERATE_OBJECTS=${OBJ}/generate.o
COMMON_OBJECTS=${OBJ}/tools.o
OBJ_C=${GENERATE_OBJECTS} ${COMMON_OBJECTS} ${TGL_OBJECTS} ${TLD_OBJECTS}

DEPENDENCE=$(subst ${OBJ}/,${DEP}/,$(patsubst %.o,%.d,${OBJ_LIST}))
DEPENDENCE_LIST=${DEPENDENCE}

INCLUDE=-I. -I${srcdir}
CC=@CC@

.SUFFIXES:

.SUFFIXES: .c .h .o

all: ${LIB_LIST}
create_dirs_and_headers: ${DIR_LIST} ${AUTO}/auto.c ${AUTO}/auto-header.h ${AUTO}/constants.h
create_dirs: ${DIR_LIST}
dump-tl: ${EXE}/dump-tl-file

include tl-parser/MAKEFILE

${DIR_LIST}:
@test -d $@ || mkdir -p $@

-include ${DEPENDENCE_LIST}

${TGL_OBJECTS}: ${AUTO}/constants.h ${AUTO}/auto-header.h

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

${LIB}/libtgl.a: ${TGL_OBJECTS} ${COMMON_OBJECTS}
ar ruv $@ ${TGL_OBJECTS} ${COMMON_OBJECTS}

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

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

${AUTO}/scheme.tl: ${srcdir}/scheme.tl ${srcdir}/encrypted_scheme.tl ${srcdir}/binlog.tl ${srcdir}/append.tl | ${AUTO}
cat $^ > $@

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

${AUTO}/auto.c: ${AUTO}/scheme.tlo ${EXE}/generate
${EXE}/generate ${AUTO}/scheme.tlo > $@

${AUTO}/auto-header.h: ${AUTO}/scheme.tlo ${EXE}/generate
${EXE}/generate -H ${AUTO}/scheme.tlo > $@

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

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

clean:
rm -rf ${DIR_LIST} config.log config.status > /dev/null || echo "all clean"

9 changes: 9 additions & 0 deletions Makefile.tl-parser
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
srcdir=.

TL_PARSER_OBJECTS=${OBJ}/tl-parser.o ${OBJ}/tlc.o ${OBJ}/crc32.o

${TL_PARSER_OBJECTS}: ${OBJ}/%.o: tl-parser/%.c | create_dirs
${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tl-parser -c -o $@ $<

${EXE}/tl-parser: ${TL_PARSER_OBJECTS}
${CC} $^ ${LINK_FLAGS} -o $@
2 changes: 2 additions & 0 deletions append.tl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
decryptedMessageMediaVideoL12#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
decryptedMessageMediaAudioL12#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia;
Loading

0 comments on commit 859829d

Please sign in to comment.