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