source: Daodan/src/makefile@ 1126

Last change on this file since 1126 was 1045, checked in by alloc, 8 years ago

Fixed warning, changed to GNU99 standard

  • Property svn:executable set to *
File size: 1.6 KB
RevLine 
[994]1# If SRC or TARGET is a folder it must end in a slash "/"
2SRC =
3TARGET = ../build/
4SUBFOLDERS = Patches beaengine
5
6DEF = BEA_ENGINE_STATIC
7INCLUDEPATHS = .
[1045]8GCCFLAGS = -std=gnu99 -O0 -Wall -fomit-frame-pointer -fpack-struct -Wextra -Wno-pragmas -Wno-unused-variable $(addprefix -I,$(INCLUDEPATHS)) -Wno-unused-parameter $(addprefix -D,$(DEF))
[994]9LINKFLAGS = -O0 -Wall -fomit-frame-pointer -fpack-struct -s -mdll
10LOCALE = LC_MESSAGES=C
11
12LIBDIRS =
13LIBS = -lgdi32 -lwsock32
14OBJS = $(SRC)binkw32.def
15OUT = $(TARGET)binkw32.dll
16
17FILES := _DLLInfo.rc $(foreach dir,. $(SUBFOLDERS),$(wildcard $(SRC)$(dir)/*.c))
18
19###################################################
20# #
21# Should not be required to change anything below #
22# #
23###################################################
24
25UNAME := $(shell uname -s)
26ifeq ("Linux","$(UNAME)")
27 GCC := i686-w64-mingw32-gcc
28 WINDRES := i686-w64-mingw32-windres
29else
30 GCC := gcc
31 WINDRES := windres
32endif
33
34DESTFOLDERS = $(addprefix $(TARGET),$(SUBFOLDERS))
35DEST = $(patsubst $(SRC)%.rc,$(TARGET)%.o,$(patsubst $(SRC)%.c,$(TARGET)%.o,$(FILES)))
36
37ALL: $(DESTFOLDERS) $(DEST) $(OBJS)
38 @echo "Linking"
39 $(LOCALE) $(GCC) $(LINKFLAGS) -o $(OUT) $(DEST) $(OBJS) $(LIBDIRS) $(LIBS)
40
41clean:
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.