-
Notifications
You must be signed in to change notification settings - Fork 168
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (21 loc) · 775 Bytes
/
Makefile
File metadata and controls
27 lines (21 loc) · 775 Bytes
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
LIBTOOL ?= libtool
PREFIX ?= /usr
INCLUDEDIR ?= ${PREFIX}/include/pystring
LIBDIR ?= ${PREFIX}/lib
CXX ?= g++
CXXFLAGS ?= -g -O3 -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2
all: libpystring.la
pystring.lo: pystring.h pystring.cpp
$(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(CXXFLAGS) -c pystring.cpp
libpystring.la: pystring.lo
$(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $< -rpath $(LIBDIR)
install: libpystring.la
$(LIBTOOL) --mode=install install -Dm755 $< $(DESTDIR)$(LIBDIR)/$<
$(LIBTOOL) --mode=install install -Dm644 pystring.h $(DESTDIR)$(INCLUDEDIR)/pystring.h
clean:
$(RM) -fr pystring.lo pystring.o libpystring.la .libs
.PHONY: test
test:
$(RM) -fr test
$(CXX) pystring.cpp test.cpp $(CXXFLAGS) -DPYSTRING_UNITTEST=1 -o test
./test