moved test programs to optional targer
[swftools.git] / lib / as3 / Makefile
1 all: parser swfdump mklib
2 tests: testwrite testrewrite testpaths testreadwrite 
3
4 D=-g -pg
5
6 abc.o: abc.c abc.h ../q.h pool.h
7         gcc $(D) -c abc.c -o abc.o
8
9 pool.o: pool.c pool.h
10         gcc $(D) -c pool.c -o pool.o
11
12 files.o: files.h files.c
13         gcc $(D) -c files.c -o files.o
14
15 registry.o: registry.h registry.c
16         gcc $(D) -c registry.c -o registry.o
17
18 tokenizer.yy.c: tokenizer.lex Makefile tokenizer.h
19         flex -Pavm2_ -8 -B -otokenizer.yy.c tokenizer.lex
20
21 tokenizer.yy.o: tokenizer.yy.c tokenizer.h parser.tab.h
22         gcc $(D) -c tokenizer.yy.c -o tokenizer.yy.o
23
24 parser.tab.h parser.tab.c: parser.y parser.h
25         bison -v --defines -pavm2_ parser.y -o parser.tab.c
26
27 parser.tab.o: parser.tab.c parser.tab.h parser.h
28         gcc $(D) -c parser.tab.c -o parser.tab.o
29
30 main.o: main.c parser.tab.h parser.h
31         gcc $(D) -c main.c -o main.o
32
33 mklib.o: mklib.c parser.tab.h parser.h
34         gcc $(D) -c mklib.c -o mklib.o
35
36 parser: parser.tab.o main.o files.o tokenizer.yy.o ../librfxswf.a ../libbase.a parser.tab.h 
37         gcc $(D) parser.tab.o main.o tokenizer.yy.o ../librfxswf.a ../libbase.a -o parser -lz
38
39 mklib: mklib.o files.o ../libbase.a
40         gcc $(D) mklib.o ../librfxswf.a ../libbase.a -o mklib -lz
41
42 ../q.o: ../q.c ../q.h ../mem.h
43         cd ..; make q.o; cd -
44
45 ../librfxswf.a: ../rfxswf.h ../rfxswf.c abc.c abc.h pool.c pool.h files.c files.h code.c code.h registry.c registry.h opcodes.c opcodes.h builtin.c builtin.h
46         cd ..; make librfxswf.a
47
48 ../libbase.a: ../q.c ../q.h ../mem.c ../mem.h
49         cd ..; make libbase.a
50
51 swfdump: ../librfxswf.a ../../src/swfdump.c ../libbase.a abc.c abc.h pool.c pool.h code.c opcodes.c ../q.c ../q.h
52         gcc -g ../../src/swfdump.c ../librfxswf.a ../libbase.a -ljpeg -lz -lfreetype -o swfdump
53
54 testreadwrite: testreadwrite.c ../librfxswf.a ../libbase.a
55         gcc $(D) -DMAIN -o testreadwrite testreadwrite.c ../librfxswf.a ../libbase.a -lz -ljpeg
56
57 testrewrite: testrewrite.c ../librfxswf.a ../libbase.a
58         gcc $(D) -DMAIN -o testrewrite testrewrite.c ../librfxswf.a ../libbase.a -lz -ljpeg
59
60 testwrite: testwrite.c ../librfxswf.a ../libbase.a
61         gcc $(D) -DMAIN -o testwrite testwrite.c ../librfxswf.a ../libbase.a -lz -ljpeg
62
63 testpaths: testpaths.c ../librfxswf.a ../libbase.a
64         gcc $(D) -DMAIN -o testpaths testpaths.c ../librfxswf.a ../libbase.a -lz -ljpeg
65
66 clean:
67         rm -f *.o *.yy.c *.tab.c *.tab.h testreadwrite swfdump testpaths testwrite ../librfxswf.a