Skip to content

Commit 72f4e3c

Browse files
committed
1 parent 6081a92 commit 72f4e3c

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Makefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CPPFLAGS=-g -Wall -fPIC
2-
CFLAGS=-g -Wall -fPIC
1+
CXXFLAGS=-Wall -fPIC -O2
2+
CFLAGS=-Wall -fPIC -O2
33

44
# Enable to test with GCC 3.4
55
# CXX=g++34
@@ -8,19 +8,19 @@ PREFIX=/usr
88

99
SOURCES=mmap_file_pool.cpp mmap_file_pool.h mmap_allocator.h mmap_access_mode.h mmappable_vector.h mmap_exception.h
1010

11-
HEADERS=mmap_access_mode.h mmap_allocator.h mmap_file_pool.h mmap_exception.h
11+
HEADERS=mmap_access_mode.h mmap_allocator.h mmap_file_pool.h mmap_exception.h mmappable_vector.h
1212
LIBRARIES=libmmap_allocator.so libmmap_allocator.a
1313

1414
SRC_INSTALL_TARGET_DIR=/home/johannes/re3
1515

16-
all: test_allocator mmap_file_pool.o $(LIBRARIES)
16+
all: $(LIBRARIES)
1717

18-
debug: CPPFLAGS+=-DMMAP_ALLOCATOR_DEBUG=1
19-
debug: CFLAGS+=-DMMAP_ALLOCATOR_DEBUG=1
18+
debug: CXXFLAGS+=-DMMAP_ALLOCATOR_DEBUG=1 -g
19+
debug: CFLAGS+=-DMMAP_ALLOCATOR_DEBUG=1 -g
2020
debug: clean all
2121

2222
libmmap_allocator.so: mmap_file_pool.o
23-
g++ -shared -o libmmap_allocator.so mmap_file_pool.o
23+
$(CXX) -shared -o libmmap_allocator.so mmap_file_pool.o
2424

2525
libmmap_allocator.a: mmap_file_pool.o
2626
ar r libmmap_allocator.a mmap_file_pool.o
@@ -29,22 +29,22 @@ install_sources: $(SOURCES)
2929
cp $(SOURCES) $(SRC_INSTALL_TARGET_DIR)
3030

3131
install: all
32-
install -m 644 $(HEADERS) $(PREFIX)/include
33-
install -m 755 $(LIBRARIES) $(PREFIX)/lib
34-
35-
test: all
32+
install -Dm 644 -t $(DESTDIR)$(PREFIX)/include $(HEADERS)
33+
install -Dm 755 -t $(DESTDIR)$(PREFIX)/lib $(LIBRARIES)
34+
35+
test: test_allocator
3636
@echo "Running mmap allocator regression test suite."
3737
bash -c 'export LD_LIBRARY_PATH=. ; ./test_allocator'
3838

39-
debugtest: debug
39+
debugtest: debug test_allocator
4040
@echo "Running mmap allocator regression test suite with verbose enabled."
4141
bash -c 'export LD_LIBRARY_PATH=. ; ./test_allocator'
4242

4343
test_allocator: mmap_allocator.h mmap_file_pool.o test_allocator.o $(LIBRARIES)
44-
g++ test_allocator.o -L. -lmmap_allocator -o test_allocator
44+
$(CXX) test_allocator.o -L. -lmmap_allocator -o test_allocator
4545

4646
test_mmap_fixed: test_mmap_fixed.c
47-
gcc $(CFLAGS) test_mmap_fixed.c -o test_mmap_fixed
47+
$(CC) $(CFLAGS) test_mmap_fixed.c -o test_mmap_fixed
4848

4949
clean:
5050
rm -f test_allocator test_mmap_fixed testfile testfile2 *.o $(LIBRARIES)

0 commit comments

Comments
 (0)