summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2010-06-21 21:08:51 -0400
committerHenrik Rydberg <rydberg@euromail.se>2010-06-22 11:44:16 +0200
commit0647b37dfc35145d74822844ad7e54bf5c218369 (patch)
tree47225422ade9159ac08d61bcf16a4a45cf336dfb
parent172221f14fc91ebb37aa4c561ad733088cc3c3bf (diff)
Move to autotools
[rydberg@euromail.se: minor fixups] Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-rw-r--r--.gitignore81
-rw-r--r--Makefile71
-rw-r--r--Makefile.am14
-rwxr-xr-xautogen.sh12
-rw-r--r--configure.ac33
-rw-r--r--mtdev.pc.in9
-rw-r--r--src/Makefile.am16
7 files changed, 162 insertions, 74 deletions
diff --git a/.gitignore b/.gitignore
index 7eb23b5..7df57dd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,78 @@
1bin 1#
2obj 2# X.Org module default exclusion patterns
3patches 3# The next section if for module specific patterns
4#
5# Do not edit the following section
6# GNU Build System (Autotools)
7aclocal.m4
8autom4te.cache/
9autoscan.log
10ChangeLog
11compile
12config.guess
13config.h
14config.h.in
15config.log
16config-ml.in
17config.py
18config.status
19config.status.lineno
20config.sub
21configure
22configure.scan
23depcomp
24.deps/
25INSTALL
26install-sh
27.libs/
28libtool
29libtool.m4
30ltmain.sh
31lt~obsolete.m4
32ltoptions.m4
33ltsugar.m4
34ltversion.m4
35Makefile
36Makefile.in
37mdate-sh
38missing
39mkinstalldirs
40*.pc
41py-compile
42stamp-h?
43symlink-tree
44texinfo.tex
45ylwrap
46
47# Do not edit the following section
48# Edit Compile Debug Document Distribute
49*~
50*.[0-9]
51*.[0-9]x
52*.bak
53*.bin
54core
55*.dll
56*.exe
57*-ISO*.bdf
58*-JIS*.bdf
59*-KOI8*.bdf
60*.kld
61*.ko
62*.ko.cmd
63*.lai
64*.l[oa]
65*.[oa]
66*.obj
67*.patch
68*.so
69*.pcf.gz
70*.pdb
71*.tar.bz2
72*.tar.gz
73#
74# Add & Override patterns for mtdev
75#
76# Edit the following section as needed
77# For example, !report.pc overrides *.pc. See 'man gitignore'
78#
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 678fee4..0000000
--- a/Makefile
+++ /dev/null
@@ -1,71 +0,0 @@
1VERSION = 1
2PATCHLEVEL = 0
3SUBLEVEL = 0
4EXTRAVERSION =
5
6LIBRARY = libmtdev
7MODULES = src
8
9o_src = match iobuf caps core
10
11TARGETS += test/mtdev-mapgen
12TARGETS += test/mtdev
13PUBINC += mtdev.h
14
15OBJECTS = $(addsuffix .o,\
16 $(foreach mod,$(MODULES),\
17 $(addprefix $(mod)/,$(o_$(mod)))))
18
19TBIN = $(addprefix bin/,$(TARGETS))
20SLIB = $(addprefix obj/,$(LIBRARY).a)
21DLIB = $(addprefix obj/,$(LIBRARY).so)
22TOBJ = $(addprefix obj/,$(addsuffix .o,$(TARGETS)))
23TINC = $(addprefix include/,$(PUBINC))
24OBJS = $(addprefix obj/,$(OBJECTS))
25LIBS =
26
27DESTINC = usr/include
28DESTLIB = usr/lib
29
30INCLUDE = -Iinclude
31OPTS = -O3 -fPIC
32
33.PHONY: all clean
34.PRECIOUS: obj/%.o
35
36all: $(OBJS) $(SLIB) $(DLIB) $(TOBJ) $(TBIN)
37
38bin/%: obj/%.o $(SLIB)
39 @mkdir -p $(@D)
40 gcc $< -o $@ $(SLIB) $(LIBS)
41
42$(SLIB): $(OBJS) $(XOBJS)
43 @rm -f $(SLIB)
44 ar qc $@ $(OBJS) $(XOBJS)
45
46$(DLIB): $(OBJS) $(XOBJS)
47 @rm -f $(DLIB)
48 gcc -shared $(OBJS) $(XOBJS) -Wl,-soname -Wl,$(LIBRARY).so -o $@
49
50obj/%.o: %.c
51 @mkdir -p $(@D)
52 gcc $(INCLUDE) $(OPTS) -c $< -o $@
53
54clean:
55 rm -rf bin obj
56
57distclean: clean
58 rm -rf debian/*.log debian/files
59
60install: $(TINC) $(SLIB) $(DLIB)
61 install -d $(DESTDIR)/$(DESTINC)
62 install -m 644 $(TINC) $(DESTDIR)/$(DESTINC)
63 install -d $(DESTDIR)/$(DESTLIB)
64 install -m 644 $(SLIB) $(DESTDIR)/$(DESTLIB)
65 install -m 755 $(DLIB) $(DESTDIR)/$(DESTLIB)
66 ldconfig -n $(DESTDIR)/$(DESTLIB)
67
68uninstall:
69 rm -f $(DESTDIR)/$(DESTLIB)/$(LIBRARY).so
70 rm -f $(DESTDIR)/$(DESTLIB)/$(LIBRARY).a
71 rm -f $(DESTDIR)/$(DESTINC)/$(PUBINC)
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..e2c1d0a
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,14 @@
1SUBDIRS = src
2
3pkgconfigdir = $(libdir)/pkgconfig
4pkgconfig_DATA = mtdev.pc
5
6INCLUDES = $(top_srcdir)/include/
7
8.PHONY: ChangeLog INSTALL
9INSTALL:
10 $(INSTALL_CMD)
11ChangeLog:
12 $(CHANGELOG_CMD)
13
14dist-hook: ChangeLog INSTALL
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,12 @@
1#! /bin/sh
2
3srcdir=`dirname $0`
4test -z "$srcdir" && srcdir=.
5
6ORIGDIR=`pwd`
7cd $srcdir
8
9autoreconf -v --install || exit 1
10cd $ORIGDIR || exit $?
11
12$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..cb59c11
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,33 @@
1# Initialize Autoconf
2AC_PREREQ([2.60])
3AC_INIT([Multitouch Protocol Translation Library],
4 [1.0.0],
5 [],
6 [mtdev])
7AC_CONFIG_SRCDIR([Makefile.am])
8AC_CONFIG_HEADERS([config.h])
9
10# Initialize Automake
11AM_INIT_AUTOMAKE([foreign dist-bzip2])
12AM_MAINTAINER_MODE
13
14LIB_VERSION=1:0:0
15AC_SUBST([LIB_VERSION])
16
17# Initialize libtool
18AC_PROG_LIBTOOL
19
20# Checks for programs.
21AC_PROG_CC
22AC_PROG_INSTALL
23
24# Initialize X.Org macros
25m4_ifndef([XORG_MACROS_VERSION],
26 [m4_fatal([must install xorg-macros 1.5 or later before running autoconf/autogen])])
27XORG_MACROS_VERSION(1.5)
28XORG_DEFAULT_OPTIONS
29
30AC_CONFIG_FILES([Makefile
31 src/Makefile
32 mtdev.pc])
33AC_OUTPUT
diff --git a/mtdev.pc.in b/mtdev.pc.in
new file mode 100644
index 0000000..de5528b
--- /dev/null
+++ b/mtdev.pc.in
@@ -0,0 +1,9 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@
5
6Name: mtdev
7Description: Multitouch Protocol Translation Library
8Version: @PACKAGE_VERSION@
9Libs: -L${libdir} -lmtdev
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..70ace68
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,16 @@
1lib_LTLIBRARIES = libmtdev.la
2
3libmtdev_la_LDFLAGS = -version-info @LIB_VERSION@
4
5libmtdev_la_SOURCES = \
6 caps.c \
7 core.c \
8 iobuf.c \
9 match.c
10
11AM_CFLAGS = $(CWARNFLAGS)
12
13INCLUDES = -I$(top_srcdir)/include/
14
15libmtdevincludedir = $(includedir)
16libmtdevinclude_HEADERS = $(top_srcdir)/include/mtdev.h