Debian Codegraph @

minorGems/util/development/leakTracer/Makefile

raw
1 #
2 # Modification History
3 #
4 # 2004-January-16 Jason Rohrer
5 # Switched to use minorGems platform-independed mutexes.
6 #
7
8
9 CC = g++
10
11 # Source files
12 SRC := LeakTracer.cc
13
14 ROOT_PATH = ../../../..
15
16 # Switch comment to select a platform
17 # PLATFORM_MUTEX = $(ROOT_PATH)/minorGems/system/win32/MutexLockWin32.cpp
18 PLATFORM_MUTEX = $(ROOT_PATH)/minorGems/system/linux/MutexLockLinux.cpp -pthread
19
20 # Comment both of these out to disable thread safetly
21 C_THREAD=-DTHREAD_SAVE -D_REENTRANT -D_THREAD_SAFE
22 O_THREAD = $(PLATFORM_MUTEX)
23
24
25 # Common flags
26 C_FLAGS = -g -pipe -Wall -W -I$(ROOT_PATH) $(C_THREAD)
27 O_FLAGS = $(C_FLAGS) $(O_THREAD)
28
29 # Object files
30 OBJ_DIR = .
31 OBJ := $(patsubst %.cc,$(OBJ_DIR)/%.o,$(SRC))
32 SHOBJ := $(patsubst %.o,$(OBJ_DIR)/%.so,$(OBJ))
33
34 .PHONY: all clean tidy distrib test
35
36 all: $(OBJ) $(SHOBJ)
37
38 clean: tidy
39 rm -f $(OBJ) leak.out
40
41 tidy:
42 rm -f *~ *orig *bak *rej
43
44 tags: $(SRC) $(INCL)
45 ctags $(SRC) $(INCL)
46
47 distrib: clean all README.html
48 (cd .. && tar cvfz /root/drylock/LeakTracer/LeakTracer.tar.gz --exclude LeakTracer/CVS --exclude LeakTracer/old --exclude LeakTracer/test LeakTracer/)
49
50 $(OBJ_DIR)/%.o: %.cc
51 $(CC) -fPIC -c $(C_FLAGS) $< -o $@
52
53 $(OBJ_DIR)/%.so : $(OBJ_DIR)/%.o
54 $(CC) $(O_FLAGS) -shared -o $@ $<
55
56 README.html: README
57 /root/ed/mcl/util/htmlize.pl README
58
59 test:
60 $(CC) $(C_FLAGS) test.cc -o test
61 ./test
62 ./LeakCheck ./test
63 ./leak-analyze ./test
64 # ./compare-test test.template test.result