-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile.mingw
65 lines (49 loc) · 2.54 KB
/
Makefile.mingw
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
62
63
64
65
CC = gcc
AR=ar rc
RANLIB=ranlib
prefix=c:/dev
bin_dir=$(prefix)/bin
include_dir=$(prefix)/include
lib_dir=$(prefix)/lib
CFLAGS = -O3 -march=athlon-xp -mmmx -msse -m3dnow -DBUILD_DLL -DWIN32 -I$(include_dir)/SDL
LIBS = -L$(lib_dir) -lSDL
OBJS = SDL_framerate.o SDL_gfxPrimitives.o SDL_imageFilter.o SDL_rotozoom.o
STATIC_LIB=libSDL_gfx.a
IMPORT_LIB=libSDL_gfx.dll.a
SHARED_LIB=SDL_gfx.dll
all: $(STATIC_LIB) $(SHARED_LIB)
$(STATIC_LIB): $(OBJS)
$(AR) $@ $^
$(RANLIB) $@
$(SHARED_LIB): $(OBJS)
gcc -s -shared -o $@ $^ -Wl,--enable-auto-import,--export-all -Wl,--out-implib=$(IMPORT_LIB) $(LIBS)
test: $(SHARED_LIB) $(STATIC_LIB) Test/TestFramerate.exe Test/TestFonts.exe Test/TestGfxPrimitives.exe Test/TestImageFilter.exe Test/TestRotozoom.exe
Test/TestFramerate.exe: Test/TestFramerate.c
gcc -c $^ -o Test/TestFramerate.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestFramerate.o $(CFLAGS) -L../ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL
Test/TestFonts.exe: Test/TestFonts.c
gcc -c $^ -o Test/TestFonts.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestFonts.o $(CFLAGS) -L../ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL
Test/TestGfxPrimitives.exe: Test/TestGfxPrimitives.c
gcc -c $^ -o Test/TestGfxPrimitives.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestGfxPrimitives.o $(CFLAGS) -L../ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL
Test/TestImageFilter.exe: Test/TestImageFilter.c
gcc -c $^ -o Test/TestImageFilter.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestImageFilter.o $(CFLAGS) -L../ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL
Test/TestRotozoom.exe: Test/TestRotozoom.c
gcc -c $^ -o Test/TestRotozoom.o -O3 -march=athlon-xp -mmmx -msse -m3dnow -DWIN32 -Ic:/dev/local/include/SDL
gcc -o $@ Test/TestRotozoom.o $(CFLAGS) -L../ -Lc:/dev/local/lib -lmingw32 -lSDLmain $(SHARED_LIB) -lSDL
install: $(STATIC_LIB) $(SHARED_LIB)
cp $(STATIC_LIB) $(SHARED_LIB) $(IMPORT_LIB) $(lib_dir)
cp SDL_framerate.h SDL_gfxPrimitives.h SDL_imageFilter.h SDL_rotozoom.h $(include_dir)/SDL
uninstall:
rm -f $(lib_dir)/$(STATIC_LIB)
rm -f $(lib_dir)/$(SHARED_LIB)
rm -f $(lib_dir)/$(IMPORT_LIB)
rm -f $(include_dir)/SDL/SDL_framerate.h
rm -f $(include_dir)/SDL/SDL_gfxPrimitives.h
rm -f $(include_dir)/SDL/SDL_imageFilter.h
rm -f $(include_dir)/SDL/SDL_rotozoom.h
clean:
rm -f *.o *.a *.dll
rm -f Test/*.o Test/*.exe