summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-06-22 23:12:53 (GMT)
committerJan Engelhardt <jengelh@medozas.de>2009-06-22 23:24:51 (GMT)
commitbf4fd3acee4e611afee20025f55454e37813f8ca (patch)
treed2bc642c03454626551adc86cb56f34e45530f2a /src
parentef8ba32e0ca7ac7bbbaf87f6fd7b197af18aed25 (diff)
downloadlibnl-bf4fd3acee4e611afee20025f55454e37813f8ca.zip
libnl-bf4fd3acee4e611afee20025f55454e37813f8ca.tar.gz
libnl-bf4fd3acee4e611afee20025f55454e37813f8ca.tar.bz2
Move to automake-based build
Issues solved: * PACKAGE_VERSION was abused for SOVERSION * unneeded DEP stage * did not support out-of-tree builds * no way to turn off silent mode * overriding CFLAGS at make time was not supported * no static libs were provided Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'src')
-rw-r--r--src/Makefile62
-rw-r--r--src/Makefile.am86
2 files changed, 86 insertions, 62 deletions
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index 6a7bfd2..0000000
--- a/src/Makefile
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# src/Makefile
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation version 2.1
-# of the License.
-#
-# Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
-#
-
-ifeq ($(shell [ ! -r ../Makefile.opts ] && echo 1),)
- include ../Makefile.opts
-endif
-
-LDFLAGS += -L../lib -lnl
-CIN := $(wildcard nl-*.c) $(wildcard genl-*.c) $(wildcard nf-*.c)
-TOOLS := $(CIN:%.c=%)
-
-all: $(TOOLS)
-
-$(TOOLS): utils.o
-nl-route-add nl-route-delete nl-route-list: route-utils.o rtnl-utils.o
-nl-route-get: rtnl-utils.o
-nl-addr-add nl-addr-delete nl-addr-list: addr-utils.o rtnl-utils.o
-nl-link-list nl-link-set nl-link-stats: link-utils.o rtnl-utils.o
-nl-link-ifindex2name nl-link-name2ifindex: rtnl-utils.o
-nl-neigh-add nl-neigh-delete nl-neigh-list: neigh-utils.o rtnl-utils.o
-nl-qdisc-delete nl-qdisc-list: qdisc-utils.o rtnl-utils.o
-nl-rule-list: rule-utils.o rtnl-utils.o
-nl-neightbl-list: rtnl-utils.o
-nl-monitor: rtnl-utils.o
-nl-tctree-list: rtnl-utils.o
-
-genl-ctrl-list: ctrl-utils.o
-
-nf-ct-list: ct-utils.o
-nf-log: log-utils.o rtnl-utils.o
-nf-queue: queue-utils.o rtnl-utils.o
-
-nl-%: nl-%.o
- @echo " LD $@"; \
- $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnl-route
-
-genl-%: genl-%.o
- @echo " LD $@"; \
- $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnl-genl
-
-nf-%: nf-%.o
- @echo " LD $@"; \
- $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lnl-nf -lnl-route
-
-clean:
- @echo " CLEAN src"; \
- rm -f $(TOOLS) *.o
-
-distclean: clean
-
-install:
- @true
-
-include ../Makefile.rules
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..9f52cd6
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,86 @@
+# -*- Makefile -*-
+
+AM_CFLAGS = -Wall -I${top_srcdir}/include
+AM_LDFLAGS = -L${top_builddir}/lib
+
+noinst_PROGRAMS = \
+ genl-ctrl-list \
+ nf-ct-list nf-log nf-queue \
+ nl-addr-add nl-addr-delete nl-addr-list \
+ nl-link-list nl-link-set nl-link-stats \
+ nl-link-ifindex2name nl-link-name2ifindex \
+ nl-neigh-add nl-neigh-delete nl-neigh-list \
+ nl-qdisc-delete nl-qdisc-list \
+ nl-rule-list \
+ nl-neightbl-list \
+ nl-monitor \
+ nl-tctree-list \
+ nl-route-add nl-route-delete nl-route-get nl-route-list
+
+rtnl_utils_c = rtnl-utils.c utils.c
+
+genl_ctrl_list_SOURCES = genl-ctrl-list.c ctrl-utils.c utils.c
+genl_ctrl_list_LDADD = -lnl -lnl-genl
+
+nf_ct_list_SOURCES = nf-ct-list.c ct-utils.c utils.c
+nf_ct_list_LDADD = -lnl -lnl-nf -lnl-route
+nf_log_SOURCES = nf-log.c log-utils.c ${rtnl_utils_c}
+nf_log_LDADD = -lnl -lnl-nf -lnl-route
+nf_queue_SOURCES = nf-queue.c queue-utils.c ${rtnl_utils_c}
+nf_queue_LDADD = -lnl -lnl-nf -lnl-route
+
+addr_c = addr-utils.c ${rtnl_utils_c}
+nl_addr_add_SOURCES = nl-addr-add.c ${addr_c}
+nl_addr_add_LDADD = -lnl -lnl-route
+nl_addr_delete_SOURCES = nl-addr-delete.c ${addr_c}
+nl_addr_delete_LDADD = -lnl -lnl-route
+nl_addr_list_SOURCES = nl-addr-list.c ${addr_c}
+nl_addr_list_LDADD = -lnl -lnl-route
+
+link_c = link-utils.c ${rtnl_utils_c}
+nl_link_list_SOURCES = nl-link-list.c ${link_c}
+nl_link_list_LDADD = -lnl -lnl-route
+nl_link_set_SOURCES = nl-link-set.c ${link_c}
+nl_link_set_LDADD = -lnl -lnl-route
+nl_link_stats_SOURCES = nl-link-stats.c ${link_c}
+nl_link_stats_LDADD = -lnl -lnl-route
+nl_link_ifindex2name_SOURCES = nl-link-ifindex2name.c ${rtnl_utils_c}
+nl_link_ifindex2name_LDADD = -lnl -lnl-route
+nl_link_name2ifindex_SOURCES = nl-link-name2ifindex.c ${rtnl_utils_c}
+nl_link_name2ifindex_LDADD = -lnl -lnl-route
+
+nl_monitor_SOURCES = nl-monitor.c ${rtnl_utils_c}
+nl_monitor_LDADD = -lnl -lnl-route
+
+neigh_c = neigh-utils.c ${rtnl_utils_c}
+nl_neigh_add_SOURCES = nl-neigh-add.c ${neigh_c}
+nl_neigh_add_LDADD = -lnl -lnl-route
+nl_neigh_delete_SOURCES = nl-neigh-delete.c ${neigh_c}
+nl_neigh_delete_LDADD = -lnl -lnl-route
+nl_neigh_list_SOURCES = nl-neigh-list.c ${neigh_c}
+nl_neigh_list_LDADD = -lnl -lnl-route
+
+nl_neightbl_list_SOURCES = nl-neightbl-list.c ${rtnl_utils_c}
+nl_neightbl_list_LDADD = -lnl -lnl-route
+
+qdisc_c = qdisc-utils.c ${rtnl_utils_c}
+nl_qdisc_delete_SOURCES = nl-qdisc-delete.c ${qdisc_c}
+nl_qdisc_delete_LDADD = -lnl -lnl-route
+nl_qdisc_list_SOURCES = nl-qdisc-list.c ${qdisc_c}
+nl_qdisc_list_LDADD = -lnl -lnl-route
+
+route_c = route-utils.c ${rtnl_utils_c}
+nl_route_add_SOURCES = nl-route-add.c ${route_c}
+nl_route_add_LDADD = -lnl -lnl-route
+nl_route_delete_SOURCES = nl-route-delete.c ${route_c}
+nl_route_delete_LDADD = -lnl -lnl-route
+nl_route_get_SOURCES = nl-route-get.c ${route_c}
+nl_route_get_LDADD = -lnl -lnl-route
+nl_route_list_SOURCES = nl-route-list.c ${route_c}
+nl_route_list_LDADD = -lnl -lnl-route
+
+nl_rule_list_SOURCES = nl-rule-list.c rule-utils.c ${rtnl_utils_c}
+nl_rule_list_LDADD = -lnl -lnl-route
+
+nl_tctree_list_SOURCES = nl-tctree-list.c ${rtnl_utils_c}
+nl_tctree_list_LDADD = -lnl -lnl-route