Skip to content

Commit 7e44a26

Browse files
committed
rewrote makefile, now supports mingw
git-svn-id: svn://svn.icculus.org/twilight/trunk/dpvideo@7584 d7cf8633-e32d-0410-b094-e92efae38249
1 parent a2f2080 commit 7e44a26

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

makefile

+31-27
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,49 @@
11

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-
112
#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
146
#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
1718

18-
LDFLAGS= -lm $(PROFILEOPTION)
19+
dpvencoder: dpvencoder.c dpvencode.c file.c tgafile.c
20+
$(CC) -o $@ $^ $(FLAGS)
1921

20-
TARGETS= dpvencoder dpvdecoder dpvplayer dpvsimpleplayer
22+
dpvdecoder: dpvdecoder.c dpvdecode.c file.c tgafile.c
23+
$(CC) -o $@ $^ $(FLAGS)
2124

22-
all: $(TARGETS)
25+
dpvplayer: dpvplayer.c dpvdecode.c
26+
$(CC) -o $@ $^ `sdl-config --cflags` `sdl-config --libs` $(FLAGS)
2327

24-
.c.o:
25-
gcc $(CFLAGS) -c $*.c
28+
dpvsimpleplayer: dpvsimpleplayer.c dpvsimpledecode.c
29+
$(CC) -o $@ $^ `sdl-config --cflags` `sdl-config --libs` $(FLAGS)
2630

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)
2933

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)
3236

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)
3539

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)
3842

3943

4044

4145
clean:
42-
-rm -f $(TARGETS) *.exe *.o *.d
46+
-rm -f dpvencoder dpvdecoder dpvplayer dpvsimpleplayer *.exe *.o *.d
4347

4448
.PHONY: clean
4549

0 commit comments

Comments
 (0)