a319f37b8ab40019b83bb61803c73444119f305f
[tridge/junkcode.git] / alloc_mmap / Makefile
1 CFLAGS=-Wall -O3 -DPAGE_SIZE=4096
2
3 .SUFFIXES: .po .o .c .so .to
4
5 .c.po:
6         $(CC) $(CFLAGS) -c -fPIC -o $@ $^
7
8 .c.to:
9         $(CC) $(CFLAGS) -DTHREAD_SAFE -c -fPIC -o $@ $^
10
11 all: alloc_mmap.so alloc_mmap_thread_safe.so testsuite testsuite_malloc testsuite_thread_safe
12
13 alloc_mmap.so: alloc_mmap.po
14         ld -shared -o $@ $^ $(LIBS)
15
16 alloc_mmap_thread_safe.so: alloc_mmap.to
17         ld -shared -o $@ $^ $(LIBS) -lpthread
18
19 testsuite: alloc_mmap.o testsuite.o
20         $(CC) $(CFLAGS) -o testsuite alloc_mmap.o testsuite.o
21
22 testsuite_malloc: testsuite.o
23         $(CC) $(CFLAGS) -o testsuite_malloc testsuite.o
24
25 testsuite_pthread: testsuite.o
26         $(CC) $(CFLAGS) -o testsuite_pthread testsuite.o -lpthread
27
28 testsuite_thread_safe: testsuite.o alloc_mmap.to
29         $(CC) $(CFLAGS) -o testsuite_thread_safe alloc_mmap.to testsuite.o -lpthread
30
31 clean:
32         /bin/rm -f *.o *.so *.to *.po *~ *.gc??