4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation version 2.1
9 # Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
12 ifeq ($(shell [ ! -r ../Makefile.opts ] && echo 1),)
13 include ../Makefile.opts
17 CIN := $(wildcard *.c)
19 CIN += $(wildcard route/*.c)
21 CIN += $(wildcard route/sch/*.c)
23 CIN += $(wildcard route/cls/*.c)
25 CIN += $(wildcard route/link/*.c)
27 CIN += $(wildcard genl/*.c)
29 CIN += $(wildcard fib_lookup/*.c)
31 CIN += $(wildcard netfilter/*.c)
33 DEPS := $(CIN:%.c=%.d)
36 OUT_SLIB := $(PACKAGE_NAME).so.$(PACKAGE_VERSION)
37 LN_SLIB := $(PACKAGE_NAME).so
38 LN1_SLIB := $(LN_SLIB).1
42 .PHONY: all clean install librtn.a $(OUT_SLIB)
46 @echo " MAKE $(OUT_SLIB)"; \
49 $(OUT_SLIB): ../Makefile.opts $(OBJ)
50 @echo " LD $(OUT_SLIB)"; \
51 $(CC) -shared -Wl,-soname,libnl.so.1 -o $(OUT_SLIB) $(OBJ) $(LIBNL_LIB) -lc
52 @echo " LN $(OUT_SLIB) $(LN1_SLIB)"; \
53 rm -f $(LN1_SLIB) ; $(LN) -s $(OUT_SLIB) $(LN1_SLIB)
54 @echo " LN $(LN1_SLIB) $(LN_SLIB)"; \
55 rm -f $(LN_SLIB) ; $(LN) -s $(LN1_SLIB) $(LN_SLIB)
59 $(RM) -f $(OBJ) $(OUT_SLIB) $(LN_SLIB) $(LN1_SLIB); \
60 $(RM) -f $(DEPS) $(OUT_SLIB) $(LN_SLIB) $(LN1_SLIB)
63 @echo " DISTCLEAN lib"; \
67 mkdir -p $(DESTDIR)$(libdir)/
68 install -m 0644 $(OUT_SLIB) $(DESTDIR)$(libdir)
69 rm -f $(DESTDIR)$(libdir)/$(LN1_SLIB)
70 $(LN) -s $(OUT_SLIB) $(DESTDIR)$(libdir)/$(LN1_SLIB)
71 rm -f $(DESTDIR)$(libdir)/$(LN_SLIB)
72 $(LN) -s $(LN1_SLIB) $(DESTDIR)$(libdir)/$(LN_SLIB)
74 $(DEPS): ../Makefile.opts
76 include ../Makefile.rules