summaryrefslogtreecommitdiff
path: root/glcdskin/Makefile
blob: ec63d3082027358b487adfbd1520cd556f447ad9 (plain)
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
#
# Makefile for the GraphLCD skin library
#

include ../Make.config

CXXFLAGS += -fPIC

VERMAJOR = 2
VERMINOR = 1
VERMICRO = 0

BASENAME = libglcdskin.so

LIBNAME = $(BASENAME).$(VERMAJOR).$(VERMINOR).$(VERMICRO)

OBJS = cache.o config.o display.o font.o function.o object.o parser.o skin.o string.o type.o variable.o xml.o

HEADERS = cache.h config.h display.h font.h function.h object.h parser.h skin.h string.h type.h variable.h xml.h


### Inner graphlcd-base dependencies
LIBS += -L../glcdgraphics -lglcdgraphics -L../glcddrivers -lglcddrivers

ifdef HAVE_FONTCONFIG
  LIBS +=  -lfontconfig
  DEFINES += -DHAVE_FONTCONFIG
endif

### Implicit rules:

%.o: %.c
	$(CXX) $(CXXEXTRA) $(CXXFLAGS) -I.. -c $(DEFINES) $(INCLUDES) $<

# Dependencies:

DEPFILE = $(OBJS:%.o=%.d)

-include $(DEPFILE)

### Targets:

all: $(LIBNAME)

$(LIBNAME): $(OBJS)
	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -Wl,-soname="$(BASENAME).$(VERMAJOR)" -Wl,--no-undefined -o $@
	ln -sf $(LIBNAME) $(BASENAME)

install: all
	install -d $(DESTDIR)$(LIBDIR)
	install -m 755 $(LIBNAME) $(DESTDIR)$(LIBDIR)/
	install -d $(DESTDIR)$(INCDIR)/glcdskin
	install -m 644 $(HEADERS) $(DESTDIR)$(INCDIR)/glcdskin/
	( cd $(DESTDIR)$(LIBDIR); ln -sf $(LIBNAME) $(BASENAME).$(VERMAJOR); ln -sf $(LIBNAME) $(BASENAME) )

uninstall:
	rm -f $(DESTDIR)$(LIBDIR)/$(BASENAME)
	rm -f $(DESTDIR)$(LIBDIR)/$(BASENAME).$(VERMAJOR)
	rm -f $(DESTDIR)$(LIBDIR)/$(LIBNAME)
	(for i in $(HEADERS); do rm -f $(DESTDIR)$(INCDIR)/glcdskin/$$i; done)
	rmdir $(DESTDIR)$(INCDIR)/glcdskin

clean:
	rm -f $(OBJS) $(DEPFILE) $(LIBNAME) $(BASENAME) *~