|
1 | 1 |
|
2 |
| -#use this line for profiling |
3 |
| -#PROFILEOPTION=-pg -g |
4 |
| -#use this lines for no profiling |
5 |
| -PROFILEOPTION= |
6 |
| - |
7 |
| -#note: |
8 |
| -#the -Werror can be removed to compile even if there are warnings, |
9 |
| -#this is used to ensure that all released versions are free of warnings. |
10 |
| - |
11 | 2 | #normal compile
|
12 |
| -OPTIMIZATIONS= -O2 -fexpensive-optimizations |
13 |
| -CFLAGS= `sdl-config --cflags` -MD -Wall $(OPTIMIZATIONS) $(PROFILEOPTION) |
| 3 | +FLAGS= -lm -Wall -O2 -fexpensive-optimizations $(PROFILEOPTION) |
| 4 | +#profile compile |
| 5 | +#FLAGS= -lm -Wall -O2 -fexpensive-optimizations -pg -g |
14 | 6 | #debug compile
|
15 |
| -#OPTIMIZATIONS= |
16 |
| -#CFLAGS= `sdl-config --cflags` -MD -Wall -ggdb $(OPTIMIZATIONS) $(PROFILEOPTION) |
| 7 | +#FLAGS= -lm -Wall -ggdb $(PROFILEOPTION) |
| 8 | + |
| 9 | +all: |
| 10 | +ifdef windir |
| 11 | + $(MAKE) mingw |
| 12 | +else |
| 13 | + $(MAKE) dpvencoder dpvdecoder dpvplayer dpvsimpleplayer |
| 14 | +endif |
| 15 | + |
| 16 | +mingw: |
| 17 | + $(MAKE) dpvencoder.exe dpvdecoder.exe dpvplayer.exe dpvsimpleplayer.exe |
17 | 18 |
|
18 |
| -LDFLAGS= -lm $(PROFILEOPTION) |
| 19 | +dpvencoder: dpvencoder.c dpvencode.c file.c tgafile.c |
| 20 | + $(CC) -o $@ $^ $(FLAGS) |
19 | 21 |
|
20 |
| -TARGETS= dpvencoder dpvdecoder dpvplayer dpvsimpleplayer |
| 22 | +dpvdecoder: dpvdecoder.c dpvdecode.c file.c tgafile.c |
| 23 | + $(CC) -o $@ $^ $(FLAGS) |
21 | 24 |
|
22 |
| -all: $(TARGETS) |
| 25 | +dpvplayer: dpvplayer.c dpvdecode.c |
| 26 | + $(CC) -o $@ $^ `sdl-config --cflags` `sdl-config --libs` $(FLAGS) |
23 | 27 |
|
24 |
| -.c.o: |
25 |
| - gcc $(CFLAGS) -c $*.c |
| 28 | +dpvsimpleplayer: dpvsimpleplayer.c dpvsimpledecode.c |
| 29 | + $(CC) -o $@ $^ `sdl-config --cflags` `sdl-config --libs` $(FLAGS) |
26 | 30 |
|
27 |
| -dpvencoder: dpvencoder.o dpvencode.o file.o tgafile.o |
28 |
| - gcc -o $@ $^ $(LDFLAGS) |
| 31 | +dpvencoder.exe: dpvencoder.c dpvencode.c file.c tgafile.c |
| 32 | + $(CC) -o $@ $^ $(FLAGS) |
29 | 33 |
|
30 |
| -dpvdecoder: dpvdecoder.o dpvdecode.o file.o tgafile.o |
31 |
| - gcc -o $@ $^ $(LDFLAGS) |
| 34 | +dpvdecoder.exe: dpvdecoder.c dpvdecode.c file.c tgafile.c |
| 35 | + $(CC) -o $@ $^ $(FLAGS) |
32 | 36 |
|
33 |
| -dpvplayer: dpvplayer.o dpvdecode.o |
34 |
| - gcc -o $@ $^ $(LDFLAGS) -lSDL -lSDLmain -lpthread |
| 37 | +dpvplayer.exe: dpvplayer.c dpvdecode.c |
| 38 | + $(CC) -o $@ $^ `sdl-config --cflags` `sdl-config --libs` $(FLAGS) |
35 | 39 |
|
36 |
| -dpvsimpleplayer: dpvsimpleplayer.o dpvsimpledecode.o |
37 |
| - gcc -o $@ $^ $(LDFLAGS) -lSDL -lSDLmain -lpthread |
| 40 | +dpvsimpleplayer.exe: dpvsimpleplayer.c dpvsimpledecode.c |
| 41 | + $(CC) -o $@ $^ `sdl-config --cflags` `sdl-config --libs` $(FLAGS) |
38 | 42 |
|
39 | 43 |
|
40 | 44 |
|
41 | 45 | clean:
|
42 |
| - -rm -f $(TARGETS) *.exe *.o *.d |
| 46 | + -rm -f dpvencoder dpvdecoder dpvplayer dpvsimpleplayer *.exe *.o *.d |
43 | 47 |
|
44 | 48 | .PHONY: clean
|
45 | 49 |
|
|
0 commit comments