-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
95 lines (66 loc) · 1.69 KB
/
makefile
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
94
# -*- makefile -*-
# Makefile for Generic Unix with GCC compiler
DEBUG?=1
# Default install directory
PREFIX ?= /usr/local
# Place where to copy CppGC header files
INCSPATH=$(PREFIX)/include/cppgc
#Place where to copy CppGC library
LIBSPATH=$(PREFIX)/lib
GC_OBJS = gc.o threadctx.o
GC_INCS = gc.h threadctx.h gcclasses.h
GC_LIB = libgc.a
GC_EXAMPLES = testgc mallocbench
TFLAGS = -pthread
CC = g++
ifeq ($(DEBUG), 1)
OPTIMIZATION=-O0
else
OPTIMIZATION=-O3
endif
CFLAGS = -c -I. -Wall $(OPTIMIZATION) -g -fPIC $(TFLAGS)
LD = $(CC)
LDFLAGS = -g $(TFLAGS)
AR = ar
ARFLAGS = -cru
ifneq (,$(findstring FreeBSD,$(OSTYPE)))
RANLIB = ranlib
else
RANLIB = true
endif
library: $(GC_LIB)
all: library examples
gc.o: gc.cpp $(GC_INCS)
$(CC) $(CFLAGS) gc.cpp
threadctx.o: threadctx.cpp $(GC_INCS)
$(CC) $(CFLAGS) threadctx.cpp
$(GC_LIB): $(GC_OBJS)
rm -f $(GC_LIB)
$(AR) $(ARFLAGS) $(GC_LIB) $(GC_OBJS)
$(RANLIB) $(GC_LIB)
examples: $(GC_EXAMPLES)
testgc: testgc.o $(GC_LIB)
$(LD) $(LDFLAGS) -o testgc testgc.o $(GC_LIB)
testgc.o: samples/testgc.cpp $(GC_INCS)
$(CC) $(CFLAGS) samples/testgc.cpp
mallocbench: mallocbench.o $(GC_LIB)
$(LD) $(LDFLAGS) -std=c++0x -o mallocbench mallocbench.o $(GC_LIB)
mallocbench.o: samples/mallocbench.cpp $(GC_INCS)
$(CC) $(CFLAGS) -std=c++0x samples/mallocbench.cpp
documentation:
doxygen doxygen.cfg
install: library
mkdir -p $(INCSPATH)
cp $(GC_INCS) $(INCSPATH)
mkdir -p $(LIBSPATH)
cp $(GC_LIB) $(LIBSPATH)
uninstall:
rm -fr $(INCSPATH)
cd $(LIBSPATH); rm -f $(GC_LIB)
clean:
make -C copygc clean
rm -f *.o *.a *.so *.so.* $(GC_EXAMPLES)
tgz: clean
cd ..; tar --exclude=.svn -chvzf cppgc-1.02.tar.gz cppgc
zip: clean
cd ..; zip -r cppgc.zip cppgc