author | root@rika |
Wed, 06 Feb 2008 17:32:55 +0000 | |
changeset 4 | df6a40031aa5 |
permissions | -rw-r--r-- |
root@4 | 1 |
# |
root@4 | 2 |
# Makefile for the GraphLCD graphics library |
root@4 | 3 |
# |
root@4 | 4 |
|
root@4 | 5 |
-include ../Make.config |
root@4 | 6 |
|
root@4 | 7 |
CXXFLAGS += -fPIC |
root@4 | 8 |
|
root@4 | 9 |
VERMAJOR = 2 |
root@4 | 10 |
VERMINOR = 0 |
root@4 | 11 |
VERMICRO = 0 |
root@4 | 12 |
|
root@4 | 13 |
BASENAME = libglcdgraphics.so |
root@4 | 14 |
|
root@4 | 15 |
LIBNAME = $(BASENAME).$(VERMAJOR).$(VERMINOR).$(VERMICRO) |
root@4 | 16 |
|
root@4 | 17 |
OBJS = bitmap.o common.o font.o glcd.o image.o imagefile.o pbm.o |
root@4 | 18 |
|
root@4 | 19 |
HEADERS = bitmap.h font.h glcd.h image.h imagefile.h pbm.h |
root@4 | 20 |
|
root@4 | 21 |
### Implicit rules: |
root@4 | 22 |
|
root@4 | 23 |
%.o: %.c |
root@4 | 24 |
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< |
root@4 | 25 |
|
root@4 | 26 |
# Dependencies: |
root@4 | 27 |
|
root@4 | 28 |
MAKEDEP = g++ -MM -MG |
root@4 | 29 |
DEPFILE = .dependencies |
root@4 | 30 |
$(DEPFILE): Makefile |
root@4 | 31 |
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ |
root@4 | 32 |
|
root@4 | 33 |
-include $(DEPFILE) |
root@4 | 34 |
|
root@4 | 35 |
ifdef HAVE_FREETYPE2 |
root@4 | 36 |
ifneq ($(shell which freetype-config),) |
root@4 | 37 |
INCLUDES += $(shell freetype-config --cflags) |
root@4 | 38 |
LIBS += $(shell freetype-config --libs) |
root@4 | 39 |
else |
root@4 | 40 |
INCLUDES += -I/usr/include/freetype -I/usr/local/include/freetype |
root@4 | 41 |
LIBS += -lfreetype |
root@4 | 42 |
endif |
root@4 | 43 |
DEFINES += -DHAVE_FREETYPE2 |
root@4 | 44 |
endif### Targets: |
root@4 | 45 |
|
root@4 | 46 |
all: $(LIBNAME) |
root@4 | 47 |
|
root@4 | 48 |
$(LIBNAME): $(OBJS) |
root@4 | 49 |
$(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -Wl,-soname="$(BASENAME).$(VERMAJOR)" -o $@ |
root@4 | 50 |
ln -sf $(LIBNAME) $(BASENAME) |
root@4 | 51 |
|
root@4 | 52 |
install: all |
root@4 | 53 |
install -d $(LIBDIR) |
root@4 | 54 |
install -m 755 $(LIBNAME) $(LIBDIR)/ |
root@4 | 55 |
install -d $(INCDIR)/glcdgraphics |
root@4 | 56 |
install -m 644 $(HEADERS) $(INCDIR)/glcdgraphics/ |
root@4 | 57 |
( cd $(LIBDIR); ln -sf $(LIBNAME) $(BASENAME).$(VERMAJOR); ln -sf $(LIBNAME) $(BASENAME) ) |
root@4 | 58 |
|
root@4 | 59 |
uninstall: |
root@4 | 60 |
rm -f $(LIBDIR)/$(BASENAME) |
root@4 | 61 |
rm -f $(LIBDIR)/$(BASENAME).$(VERMAJOR) |
root@4 | 62 |
rm -f $(LIBDIR)/$(LIBNAME) |
root@4 | 63 |
(for i in $(HEADERS); do rm -f $(INCDIR)/glcdgraphics/$$i; done) |
root@4 | 64 |
rmdir $(INCDIR)/glcdgraphics |
root@4 | 65 |
|
root@4 | 66 |
clean: |
root@4 | 67 |
rm -f $(OBJS) $(DEPFILE) $(LIBNAME) $(BASENAME) *~ |
root@4 | 68 |