source: Daodan/makefile@ 876

Last change on this file since 876 was 876, checked in by gumby, 11 years ago

Daodan pass 1

  • Property svn:executable set to *
File size: 1.5 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
10DEF = NOFLATLINE
11GCCFLAGS = -std=c99 -O0 -Wall -fomit-frame-pointer -fpack-struct -Wextra -Wno-unused-variable -Wno-unused-parameter -D $(DEF)
12LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll
13LOCALE = LC_MESSAGES=C
14
15#LIBS = -lwinmm -lopengl32 -lgdi32
16LIBS = -lgdi32 -lwsock32
17OBJS = src/binkw32.def
18OUT = build/binkw32.dll
19
20FOLDERS = patches
21SRC = 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 src/Flatline.c src/Flatline_BSL.c src/Flatline_Client.c src/Flatline_Hooks.c src/Flatline_Net.c src/Flatline_Packet.c src/Flatline_PacketReader.c src/Flatline_PacketBuilder.c src/Flatline_Server.c src/Flatline_Win32.c src/Mariusnet.c src/Flatline_Events.c
22DEST = $(patsubst src/%.rc,build/%.o,$(patsubst src/%.c,build/%.o,$(SRC)))
23
24
25ALL: $(FOLDERS) $(DEST) $(OBJS)
26 @echo "Linking"
27 $(LOCALE) $(GCC) $(LINKFLAGS) -o $(OUT) $(DEST) $(OBJS) $(LIBS)
28
29clean:
30 rm $(DEST)
31 rm -R $(FOLDERS)
32 rm $(OUT)
33
34$(FOLDERS):
35 mkdir -p build/$@
36
37build/%.o: src/%.c
38 @echo "Compiling $<"
39 $(LOCALE) $(GCC) $(GCCFLAGS) -c -o $@ $<
40 @echo
41
42build/%.o: src/%.rc
43 @echo "Assembling resource $<"
44 $(WINDRES) -i $< -o $@
45 @echo
46
Note: See TracBrowser for help on using the repository browser.