source: Daodan/makefile@ 683

Last change on this file since 683 was 683, checked in by alloc, 12 years ago

Daodan: Makefile

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1ifneq (,$(findstring /cygdrive/,$(PATH)))
2 UNAME := Cygwin
3else
4ifneq (,$(findstring WINDOWS,$(PATH)))
5 UNAME := Windows
6else
7 UNAME := $(shell uname -s)
8endif
9endif
10
11ifeq ("Linux","$(UNAME)")
12 GCC := i686-w64-mingw32-gcc
13 DLLTOOL := i686-w64-mingw32-dlltool
14else
15 GCC := gcc
16 DLLTOOL := dlltool
17endif
18
19GCCFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct
20LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll -mthread
21
22#LIBS = -lwinmm -lopengl32 -lgdi32
23LIBS = -lgdi32
24OBJS = obj/binkw32.a
25OUT = build/binkw32.dll
26
27SRC = src/Daodan.c src/Daodan_BSL.c src/Daodan_Character.c src/Daodan_Cheater.c src/Daodan_Console.c src/Daodan_DLLStubs.c src/daodan_gl.c src/Daodan_Patch.c src/Daodan_Persistence.c src/Daodan_Utility.c src/Daodan_Win32.c src/Daodan_WindowHack.c src/inifile_reader.c src/Oni_Symbols.c
28DEST = $(patsubst src/%.c,build/%.o,$(SRC))
29
30ALL: $(FOLDERS) $(DEST) $(OBJS)
31 echo "Linking $<"
32 $(GCC) $(LINKFLAGS) -o $(OUT) $(DEST) $(OBJS) $(LIBS)
33
34clean:
35 rm $(DEST)
36 rm $(OUT)
37
38obj/binkw32.a: src/binkw32.def
39 echo "Generating binkw32.a"
40 $(DLLTOOL) -d $< -l $@
41
42build/%.o: src/%.c
43 echo "Compiling $<"
44 $(GCC) $(GCCFLAGS) -c -o $@ $<
45 echo
46
47$(FOLDERS):
48 mkdir $@
Note: See TracBrowser for help on using the repository browser.