Repository navigation
Expand file tree
/
Copy pathmakefile
More file actions
61 lines (44 loc) · 1.43 KB
/
Copy pathmakefile
File metadata and controls
61 lines (44 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
OBJECTS= symtab.o perspective.o print_pcode.o matrix.o my_main.o display.o draw.o gmath.o mesh_parser.o stack.o
CFLAGS= -g
LDFLAGS= -lm
CC= gcc
SDL_CFLAGS := $(shell sdl2-config --cflags)
SDL_LFLAGS := $(shell sdl2-config --libs)
run: parser
./mdl thingmabob.mdl
parser: lex.yy.c y.tab.c y.tab.h $(OBJECTS)
gcc -o mdl $(CFLAGS) lex.yy.c y.tab.c $(OBJECTS) $(LDFLAGS) $(SDL_LFLAGS) -lSDL2_image
lex.yy.c: mdl.l y.tab.h
flex -I mdl.l
y.tab.c: mdl.y symtab.h parser.h
bison -d -y mdl.y
y.tab.h: mdl.y
bison -d -y mdl.y
symtab.o: symtab.c parser.h matrix.h
gcc -c $(CFLAGS) symtab.c
print_pcode.o: print_pcode.c parser.h matrix.h
gcc -c $(CFLAGS) print_pcode.c
matrix.o: matrix.c matrix.h
gcc -c $(CFLAGS) matrix.c
my_main.o: my_main.c parser.h print_pcode.c matrix.h display.h ml6.h draw.h mesh_parser.h stack.h
gcc -c $(CFLAGS) my_main.c
display.o: display.c display.h ml6.h matrix.h
$(CC) $(CFLAGS) $(SDL_CFLAGS) -c display.c
draw.o: draw.c draw.h display.h ml6.h matrix.h gmath.h
$(CC) $(CFLAGS) -c draw.c
gmath.o: gmath.c gmath.h matrix.h
$(CC) $(CFLAGS) -c gmath.c
perspective.o: perspective.c perspective.h matrix.h
$(CC) $(CFLAGS) -c perspective.c
mesh_parser.o: mesh_parser.c mesh_parser.h matrix.h draw.h
$(CC) $(CFLAGS) -c mesh_parser.c
stack.o: stack.c stack.h matrix.h
$(CC) $(CFLAGS) -c stack.c
clean:
rm -f y.tab.c y.tab.h
rm -f lex.yy.c
rm -rf mdl.dSYM
rm -f *.o *~
rm -f anim/*
rm -f images/*
rm -f *.png *.gif