-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·34 lines (26 loc) · 854 Bytes
/
Copy pathMakefile
File metadata and controls
executable file
·34 lines (26 loc) · 854 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
28
29
30
31
32
33
34
CLEANEXTS = o so d
CXX = g++
LDFLAGS =
CPPFLAGS =
SRCDIR = src
SOURCES = $(SRCDIR)/Stroke.cpp $(SRCDIR)/TactileBrush.cpp
HEADERS = $(SRCDIR)/Stroke.h $(SRCDIR)/TactileBrush.h
OUTPUTFILE = libtactilebrush.so
INSTALLPREFIX = /usr
LIBDIR = lib
INCDIR = include
.PHONY: all install clean
all: $(OUTPUTFILE)
$(OUTPUTFILE): $(subst .cpp,.o,$(SOURCES))
$(CXX) -shared -fPIC $(LDFLAGS) -o $@ $^
install:
mkdir -p $(LIBDIR) $(INCDIR)
install -m 644 -o root -g root $(OUTPUTFILE) $(INSTALLPREFIX)/$(LIBDIR)
install -m 644 -o root -g root $(HEADERS) $(INSTALLPREFIX)/$(INCDIR)
clean:
for file in $(CLEANEXTS); do rm -f *.$$file $(SRCDIR)/*.$$file; done
include $(subst .cpp,.d,$(SOURCES))
%.d: %.cpp
$(CXX) -M $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$