source: Daodan/makefile@ 861

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

Daodan:

  • Fixes #42
  • Breaking out patches to own file
  • Property svn:executable set to *
File size: 1.2 KB
Line 
1UNAME := $(shell uname -s)
2ifeq ("Linux","$(UNAME)")
3 GCC := i686-w64-mingw32-gcc
4 WINDRES := i686-w64-mingw32-windres
5else
6 GCC := gcc
7 WINDRES := windres
8endif
9
10GCCFLAGS = -std=c99 -O0 -Wall -fomit-frame-pointer -fpack-struct -Wextra -Wno-unused-variable -Wno-unused-parameter
11LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll
12LOCALE = LC_MESSAGES=C
13
14#LIBS = -lwinmm -lopengl32 -lgdi32
15LIBS = -lgdi32
16OBJS = src/binkw32.def
17OUT = build/binkw32.dll
18
19FOLDERS = patches
20SRC = src/Daodan.c src/Daodan_BSL.c src/Daodan_Character.c src/Daodan_Cheater.c src/Daodan_Config.c src/Daodan_Console.c src/Daodan_GL.c src/Daodan_Patch.c src/Daodan_Persistence.c src/Daodan_Utility.c src/Daodan_Win32.c src/Inifile_Reader.c src/_DLLInfo.rc src/patches/Patches.c
21DEST = $(patsubst src/%.rc,build/%.o,$(patsubst src/%.c,build/%.o,$(SRC)))
22
23ALL: $(FOLDERS) $(DEST) $(OBJS)
24 @echo "Linking"
25 $(LOCALE) $(GCC) $(LINKFLAGS) -o $(OUT) $(DEST) $(OBJS) $(LIBS)
26
27clean:
28 rm $(DEST)
29 rm -R $(FOLDERS)
30 rm $(OUT)
31
32$(FOLDERS):
33 mkdir -p build/$@
34
35build/%.o: src/%.c
36 @echo "Compiling $<"
37 $(LOCALE) $(GCC) $(GCCFLAGS) -c -o $@ $<
38 @echo
39
40build/%.o: src/%.rc
41 @echo "Assembling resource $<"
42 $(WINDRES) -i $< -o $@
43 @echo
44
Note: See TracBrowser for help on using the repository browser.