forked from mgthomas99/easy-vg
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
71 lines (54 loc) · 2 KB
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
CC=gcc
CXX=g++
CFLAGS=-O2 -Wall -fPIC
LDFLAGS=-L/opt/vc/lib -lbrcmEGL -lbrcmGLESv2 -ljpeg
INCLUDE=-I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include
FONT2OPENVG_INCLUDE=-I/usr/include/freetype2
FONT2OPENVG_LDFLAGS=-lfreetype
SRCDIR=./src
OBJDIR=./build
FONTSRCDIR=./lib
PREFIX=/usr
DEST=$(DESTDIR)$(PREFIX)
BINDIR=$(DEST)/bin
LIBDIR=$(DEST)/lib
INCDIR=$(DEST)/include
SRC=$(wildcard $(SRCDIR)/*.c)
OBJ=$(subst $(SRCDIR), $(OBJDIR), $(SRC:.c=.o))
LIB=$(OBJDIR)/libshapes.so
FONTS=$(FONTSRCDIR)/DejaVuSans.inc
all: $(LIB)
clean:
rm -rf $(OBJDIR)
rm -f $(wildcard $(FONTSRCDIR)/*.inc)
install: $(LIB)
install -m755 -p $(OBJDIR)/font2openvg $(BINDIR)
install -m755 -p $(OBJDIR)/libshapes.so $(LIBDIR)/libshapes.so.1.0.0
ln -sf $(LIBDIR)/libshapes.so.1.0.0 $(LIBDIR)/libshapes.so
ln -sf $(LIBDIR)/libshapes.so.1.0.0 $(LIBDIR)/libshapes.so.1
ln -sf $(LIBDIR)/libshapes.so.1.0.0 $(LIBDIR)/libshapes.so.1.0
install -m644 -p $(SRCDIR)/libshapes.h $(INCDIR)
install -m644 -p $(SRCDIR)/fontinfo.h $(INCDIR)
uninstall:
rm -f $(BINDIR)/font2openvg
rm -f $(BINDIR)/libshapes.so.1.0.0
rm -f $(BINDIR)/libshapes.so.1.0
rm -f $(BINDIR)/libshapes.so.1
rm -f $(INCDIR)/libshapes.h
rm -f $(INCDIR)/fontinfo.h
install-python:
cd python && python3 setup.py install --prefix=$(DEST)
# Special target for checkinstall on debians, as install-python fails there normally
install-checkinstall: install
cd python && install -m644 -p evg.py $(shell python3 -c 'import sys; print(sys.path[-1])')
$(LIB): $(OBJ)
$(CC) $(LDFLAGS) -shared -o $@ $(OBJ)
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(FONTS)
@mkdir -p $(OBJDIR)
$(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $<
$(OBJDIR)/font2openvg: ./lib/font2openvg.cpp
@mkdir -p $(OBJDIR)
$(CXX) $(CFLAGS) $(FONT2OPENVG_INCLUDE) $(FONT2OPENVG_LDFLAGS) -o $@ $<
$(FONTSRCDIR)/DejaVuSans.inc: $(OBJDIR)/font2openvg /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
$< $(word 2,$^) $@ DejaVuSans
.PHONY: all clean install install-python install-checkinstall uninstall