source: Daodan/makefile@ 984

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

Daodan:

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