author | root@rika |
Wed, 06 Feb 2008 17:37:50 +0000 | |
changeset 5 | 37602e25a04a |
parent 4 | df6a40031aa5 |
child 6 | 611d053f0972 |
permissions | -rw-r--r-- |
root@4 | 1 |
# |
root@4 | 2 |
# Makefile for the GraphLCD driver 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 = 1 |
root@4 | 10 |
VERMINOR = 0 |
root@4 | 11 |
VERMICRO = 0 |
root@4 | 12 |
|
root@4 | 13 |
BASENAME = libglcddrivers.so |
root@4 | 14 |
|
root@4 | 15 |
LIBNAME = $(BASENAME).$(VERMAJOR).$(VERMINOR).$(VERMICRO) |
root@4 | 16 |
|
root@5 | 17 |
OBJS = common.o config.o driver.o drivers.o port.o simlcd.o framebuffer.o gu140x32f.o gu256x64-372.o gu256x64-3900.o hd61830.o ks0108.o image.o sed1330.o sed1520.o t6963c.o noritake800.o serdisp.o avrctl.o g15daemon.o network.o gu126x64D-K610A4.o picctl.o |
root@4 | 18 |
|
root@4 | 19 |
HEADERS = config.h driver.h drivers.h |
root@4 | 20 |
|
root@4 | 21 |
|
root@4 | 22 |
### Implicit rules: |
root@4 | 23 |
|
root@4 | 24 |
%.o: %.c |
root@4 | 25 |
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< |
root@4 | 26 |
|
root@4 | 27 |
# Dependencies: |
root@4 | 28 |
|
root@4 | 29 |
MAKEDEP = g++ -MM -MG |
root@4 | 30 |
DEPFILE = .dependencies |
root@4 | 31 |
$(DEPFILE): Makefile |
root@4 | 32 |
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ |
root@4 | 33 |
|
root@4 | 34 |
-include $(DEPFILE) |
root@4 | 35 |
|
root@4 | 36 |
### Targets: |
root@4 | 37 |
|
root@4 | 38 |
all: $(LIBNAME) |
root@4 | 39 |
|
root@4 | 40 |
$(LIBNAME): $(OBJS) |
root@4 | 41 |
$(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -ldl -lpthread -Wl,-soname="$(BASENAME).$(VERMAJOR)" -o $@ |
root@4 | 42 |
ln -sf $(LIBNAME) $(BASENAME) |
root@4 | 43 |
|
root@4 | 44 |
install: all |
root@4 | 45 |
install -d $(LIBDIR) |
root@4 | 46 |
install -m 755 $(LIBNAME) $(LIBDIR)/ |
root@4 | 47 |
install -d $(INCDIR)/glcddrivers |
root@4 | 48 |
install -m 644 $(HEADERS) $(INCDIR)/glcddrivers/ |
root@4 | 49 |
( cd $(LIBDIR); ln -sf $(LIBNAME) $(BASENAME).$(VERMAJOR); ln -sf $(LIBNAME) $(BASENAME) ) |
root@4 | 50 |
|
root@4 | 51 |
uninstall: |
root@4 | 52 |
rm -f $(LIBDIR)/$(BASENAME) |
root@4 | 53 |
rm -f $(LIBDIR)/$(BASENAME).$(VERMAJOR) |
root@4 | 54 |
rm -f $(LIBDIR)/$(LIBNAME) |
root@4 | 55 |
(for i in $(HEADERS); do rm -f $(INCDIR)/glcddrivers/$$i; done) |
root@4 | 56 |
rmdir $(INCDIR)/glcddrivers |
root@4 | 57 |
|
root@4 | 58 |
clean: |
root@4 | 59 |
rm -f $(OBJS) $(DEPFILE) $(LIBNAME) $(BASENAME) *~ |
root@4 | 60 |