source: Daodan/makefile@ 987

Last change on this file since 987 was 983, checked in by alloc, 11 years ago

Daodan:

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1SRC = src
2TARGET = build
3SUBFOLDERS = patches flatline beaengine
4
5DEF = BEA_ENGINE_STATIC
6INCLUDEPATHS = .
7GCCFLAGS = -std=c99 -O0 -Wall -fomit-frame-pointer -fpack-struct -Wextra -Wno-pragmas -Wno-unused-variable $(addprefix -I$(SRC)/,$(INCLUDEPATHS)) -Wno-unused-parameter $(addprefix -D,$(DEF))
8LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll
9LOCALE = LC_MESSAGES=C
10
11#LIBS = -lwinmm -lopengl32
12LIBS = -lgdi32 -lwsock32
13OBJS = $(SRC)/binkw32.def
14OUT = $(TARGET)/binkw32.dll
15
16FILES := src/_DLLInfo.rc $(foreach dir,. $(SUBFOLDERS),$(wildcard $(SRC)/$(dir)/*.c))
17
18###################################################
19# #
20# Should not be required to change anything below #
21# #
22###################################################
23
24UNAME := $(shell uname -s)
25ifeq ("Linux","$(UNAME)")
26 GCC := i686-w64-mingw32-gcc
27 WINDRES := i686-w64-mingw32-windres
28else
29 GCC := gcc
30 WINDRES := windres
31endif
32
33DESTFOLDERS = $(addprefix $(TARGET)/,$(SUBFOLDERS))
34DEST = $(patsubst $(SRC)/%.rc,$(TARGET)/%.o,$(patsubst $(SRC)/%.c,$(TARGET)/%.o,$(FILES)))
35
36ALL: $(DESTFOLDERS) $(DEST) $(OBJS)
37 @echo "Linking"
38 $(LOCALE) $(GCC) $(LINKFLAGS) -o $(OUT) $(DEST) $(OBJS) $(LIBS)
39
40clean:
41 rm -f $(DEST)
42 rm -Rf $(DESTFOLDERS)
43 rm -f $(OUT)
44
45$(DESTFOLDERS):
46 mkdir -p $@
47
48$(TARGET)/%.o: $(SRC)/%.c
49 @echo "Compiling $<"
50 $(LOCALE) $(GCC) $(GCCFLAGS) -c -o $@ $<
51 @echo
52
53$(TARGET)/%.o: $(SRC)/%.rc
54 @echo "Assembling resource $<"
55 $(WINDRES) -i $< -o $@
56 @echo
57
Note: See TracBrowser for help on using the repository browser.