-
Notifications
You must be signed in to change notification settings - Fork 10
/
makefile.mingw
executable file
·93 lines (79 loc) · 2.6 KB
/
makefile.mingw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
INCLUDE = -Isysport/ \
-Icompression/ \
-Icompression/liblzf/ \
-Icompression/zlib/ \
-Icompression/lzma/ \
-Icompression/huffman/
MAKE = make -f makefile.mingw
AR = i386-mingw32-ar
RANLIB = i386-mingw32-ranlib
DEFAULT_CC = i386-mingw32-gcc
DEFAULT_DEFINE = -DZ_PREFIX
DEFAULT_ARCHFLAGS = -m32
DEFAULT_CFLAGS = -Wall -Wextra $(INCLUDE) $(DEFAULT_DEFINE) \
$(DEFAULT_ARCHFLAGS) -DMINGW
OPTFLAGS = -O3 -msse -DNDEBUG
DEBUGFLAGS = -O0 -g -DDEBUG
PGO1FLAGS = $(OPTFLAGS) -fprofile-generate
PGO2FLAGS = $(OPTFLAGS) -fprofile-use
SRCFILES := gtb-probe.c gtb-dec.c gtb-att.c sysport/sysport.c \
compression/wrap.c compression/huffman/hzip.c \
compression/lzma/LzmaEnc.c compression/lzma/LzmaDec.c \
compression/lzma/Alloc.c compression/lzma/LzFind.c \
compression/lzma/Lzma86Enc.c compression/lzma/Lzma86Dec.c \
compression/lzma/Bra86.c compression/zlib/zcompress.c \
compression/zlib/uncompr.c compression/zlib/inflate.c \
compression/zlib/deflate.c compression/zlib/adler32.c \
compression/zlib/crc32.c compression/zlib/infback.c \
compression/zlib/inffast.c compression/zlib/inftrees.c \
compression/zlib/trees.c compression/zlib/zutil.c \
compression/liblzf/lzf_c.c compression/liblzf/lzf_d.c
OBJFILES := $(patsubst %.c,%.o,$(SRCFILES))
PROFFILES := $(SRCFILES:.c=.gcno) $(SRCFILES:.c=.gcda)
LIBNAME := libgtb.a
.PHONY: all clean
.DEFAULT_GOAL := all
all:
$(MAKE) $(LIBNAME) \
CC='$(DEFAULT_CC)' \
ARCHFLAGS='$(DEFAULT_ARCHFLAGS)' \
DEFINE='$(DEFAULT_DEFINE)' \
CFLAGS='$(OPPTFLAGS) $(DEFAULT_CFLAGS)'
$(LIBNAME): $(OBJFILES)
$(AR) rcs $@ $(OBJFILES)
$(RANLIB) $@
opt:
$(MAKE) $(LIBNAME) \
CC='$(DEFAULT_CC)' \
ARCHFLAGS='$(DEFAULT_ARCHFLAGS)' \
DEFINE='$(DEFAULT_DEFINE)' \
CFLAGS='$(OPTFLAGS) $(DEFAULT_CFLAGS)' \
LDFLAGS='$(LDFLAGS)'
debug:
$(MAKE) $(LIBNAME) \
CC='$(DEFAULT_CC)' \
ARCHFLAGS='$(DEFAULT_ARCHFLAGS)' \
DEFINE='$(DEFAULT_DEFINE)' \
CFLAGS='$(DEBUGFLAGS) $(DEFAULT_CFLAGS)' \
LDFLAGS='$(LDFLAGS)'
pgo-start:
$(MAKE) $(LIBNAME) \
CC='$(DEFAULT_CC)' \
ARCHFLAGS='$(DEFAULT_ARCHFLAGS)' \
DEFINE='$(DEFAULT_DEFINE)' \
CFLAGS='$(PGO1FLAGS) $(DEFAULT_CFLAGS)' \
LDFLAGS='$(LDFLAGS) -fprofile-generate'
pgo-finish:
$(MAKE) $(LIBNAME) \
CC='$(DEFAULT_CC)' \
ARCHFLAGS='$(DEFAULT_ARCHFLAGS)' \
DEFINE='$(DEFAULT_DEFINE)' \
CFLAGS='$(PGO2FLAGS) $(DEFAULT_CFLAGS)' \
LDFLAGS='$(LDFLAGS) -fprofile-generate'
clean:
$(RM) -f $(OBJFILES) $(LIBNAME)
pgo-clean:
$(RM) -f $(PROFFILES)
.depend:
$(CC) -MM $(DEFAULT_CFLAGS) $(SRCFILES) > $@
include .depend