| 1 |
CPPFLAGS=-g -Wall -fPIC |
| 2 |
CFLAGS=-g -Wall -fPIC |
| 3 |
|
| 4 |
# Enable to test with GCC 3.4 |
| 5 |
# CXX=g++34 |
| 6 |
|
| 7 |
PREFIX=/usr |
| 8 |
|
| 9 |
SOURCES=mmap_file_pool.cpp mmap_file_pool.h mmap_allocator.h mmap_access_mode.h mmappable_vector.h mmap_exception.h |
| 10 |
|
| 11 |
HEADERS=mmap_access_mode.h mmap_allocator.h mmap_file_pool.h mmap_exception.h |
| 12 |
LIBRARIES=libmmap_allocator.so libmmap_allocator.a |
| 13 |
|
| 14 |
SRC_INSTALL_TARGET_DIR=/home/johannes/re3 |
| 15 |
|
| 16 |
all: test_allocator mmap_file_pool.o $(LIBRARIES) |
| 17 |
|
| 18 |
debug: CPPFLAGS+=-DMMAP_ALLOCATOR_DEBUG=1 |
| 19 |
debug: CFLAGS+=-DMMAP_ALLOCATOR_DEBUG=1 |
| 20 |
debug: clean all |
| 21 |
|
| 22 |
libmmap_allocator.so: mmap_file_pool.o |
| 23 |
g++ -shared -o libmmap_allocator.so mmap_file_pool.o |
| 24 |
|
| 25 |
libmmap_allocator.a: mmap_file_pool.o |
| 26 |
ar r libmmap_allocator.a mmap_file_pool.o |
| 27 |
|
| 28 |
install_sources: $(SOURCES) |
| 29 |
cp $(SOURCES) $(SRC_INSTALL_TARGET_DIR) |
| 30 |
|
| 31 |
install: all |
| 32 |
install -m 644 $(HEADERS) $(PREFIX)/include |
| 33 |
install -m 755 $(LIBRARIES) $(PREFIX)/lib |
| 34 |
|
| 35 |
test: all |
| 36 |
@echo "Running mmap allocator regression test suite." |
| 37 |
bash -c 'export LD_LIBRARY_PATH=. ; ./test_allocator' |
| 38 |
|
| 39 |
debugtest: debug |
| 40 |
@echo "Running mmap allocator regression test suite with verbose enabled." |
| 41 |
bash -c 'export LD_LIBRARY_PATH=. ; ./test_allocator' |
| 42 |
|
| 43 |
test_allocator: mmap_allocator.h mmap_file_pool.o test_allocator.o $(LIBRARIES) |
| 44 |
g++ test_allocator.o -L. -lmmap_allocator -o test_allocator |
| 45 |
|
| 46 |
test_mmap_fixed: test_mmap_fixed.c |
| 47 |
gcc $(CFLAGS) test_mmap_fixed.c -o test_mmap_fixed |
| 48 |
|
| 49 |
clean: |
| 50 |
rm -f test_allocator test_mmap_fixed testfile testfile2 *.o $(LIBRARIES) |
| 51 |
|
| 52 |
mmap_file_pool.o: mmap_file_pool.cpp mmap_file_pool.h mmap_allocator.h mmap_access_mode.h mmappable_vector.h mmap_exception.h |
| 53 |
|
| 54 |
test_allocator.o: test_allocator.cpp mmap_file_pool.h mmap_allocator.h mmap_access_mode.h mmappable_vector.h mmap_exception.h |