Make build non-recursive Unify all the different Makefile.am into a single short top level one (the test/Makefile.am file is left intact though). This makes the build system simpler to look and should encourage unifying more currently-disparate code. Some further motivation can be found in this page: http://www.flameeyes.eu/autotools-mythbuster/automake/nonrecursive.html Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
diff --git a/.gitignore b/.gitignore
index 72c4a0b..f66b0a2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -76,3 +76,5 @@ core
# Edit the following section as needed
# For example, !report.pc overrides *.pc. See 'man gitignore'
#
+
+.dirstamp
diff --git a/Makefile.am b/Makefile.am
index 2a4d448..bc29464 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,6 @@
-# Order: makekeys before src
-SUBDIRS = include makekeys src test
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = . test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xkbcommon.pc
@@ -15,3 +16,74 @@ ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL
+
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src
+AM_CFLAGS = \
+ $(X11_CFLAGS) \
+ $(XORG_COMPILER_FLAGS) \
+ $(XMALLOC_ZERO_CFLAGS) \
+ -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"'
+AM_YFLAGS = -d
+
+xkbcommonincludedir = $(includedir)/xkbcommon
+xkbcommoninclude_HEADERS = include/xkbcommon/xkbcommon.h
+
+lib_LTLIBRARIES = libxkbcommon.la
+libxkbcommon_la_LDFLAGS = -no-undefined
+libxkbcommon_la_SOURCES = \
+ src/xkbcomp/action.c \
+ src/xkbcomp/action.h \
+ src/xkbcomp/alias.c \
+ src/xkbcomp/alias.h \
+ src/xkbcomp/compat.c \
+ src/xkbcomp/expr.c \
+ src/xkbcomp/expr.h \
+ src/xkbcomp/indicators.c \
+ src/xkbcomp/indicators.h \
+ src/xkbcomp/keycodes.c \
+ src/xkbcomp/keycodes.h \
+ src/xkbcomp/keymap.c \
+ src/xkbcomp/keytypes.c \
+ src/xkbcomp/misc.c \
+ src/xkbcomp/misc.h \
+ src/xkbcomp/parseutils.c \
+ src/xkbcomp/parseutils.h \
+ src/xkbcomp/symbols.c \
+ src/xkbcomp/vmod.c \
+ src/xkbcomp/vmod.h \
+ src/xkbcomp/xkbcomp.c \
+ src/xkbcomp/xkbcomp.h \
+ src/xkbcomp/xkbparse.y \
+ src/xkbcomp/xkbpath.c \
+ src/xkbcomp/xkbpath.h \
+ src/xkbcomp/xkbscan.l \
+ src/alloc.c \
+ src/atom.c \
+ src/keysym.c \
+ src/malloc.c \
+ src/map.c \
+ src/maprules.c \
+ src/misc.c \
+ src/state.c \
+ src/text.c \
+ src/utils.c \
+ src/utils.h \
+ src/xkb.c \
+ src/xkballoc.h \
+ src/xkbmisc.h \
+ src/xkbrules.h \
+ src/XKBcommonint.h \
+ include/xkbcommon/xkbcommon.h
+
+BUILT_SOURCES = src/xkbcomp/xkbparse.h src/ks_tables.h
+CLEANFILES = src/ks_tables.h
+
+noinst_PROGRAMS = makekeys/makekeys
+makekeys_makekeys_SOURCES = makekeys/makekeys.c
+makekeys_makekeys_CC = $(CC_FOR_BUILD)
+makekeys_makekeys_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_FOR_BUILD)
+makekeys_makekeys_CFLAGS = $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
+makekeys_makekeys_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD)
+
+src/ks_tables.h: $(KEYSYMDEFS) $(top_builddir)/makekeys/makekeys$(EXEEXT)
+ $(top_builddir)/makekeys/makekeys $(KEYSYMDEFS) > $@
diff --git a/configure.ac b/configure.ac
index 724fe0d..3a4519a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,7 +29,7 @@ AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_MACRO_DIR([m4])
# Initialize Automake
-AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])
AM_MAINTAINER_MODE
# Initialize libtool
@@ -104,11 +104,7 @@ AC_ARG_WITH([xkb_config_root],
AC_SUBST([XKBCONFIGROOT])
AC_CONFIG_FILES([
- Makefile
- xkbcommon.pc
- include/Makefile
- makekeys/Makefile
- src/Makefile
- src/xkbcomp/Makefile
- test/Makefile])
+ Makefile
+ test/Makefile
+ xkbcommon.pc])
AC_OUTPUT
diff --git a/include/Makefile.am b/include/Makefile.am
deleted file mode 100644
index b929cf9..0000000
--- a/include/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-nobase_include_HEADERS = xkbcommon/xkbcommon.h
diff --git a/m4/.gitkeep b/m4/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/m4/.gitkeep
diff --git a/makekeys/Makefile.am b/makekeys/Makefile.am
deleted file mode 100644
index 1ed50a5..0000000
--- a/makekeys/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS)
-
-# need to use build-native compiler
-CC = $(CC_FOR_BUILD)
-CPPFLAGS = $(CPPFLAGS_FOR_BUILD)
-CFLAGS = $(CFLAGS_FOR_BUILD)
-LDFLAGS = $(LDFLAGS_FOR_BUILD)
-noinst_PROGRAMS = makekeys
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 2aed33d..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-SUBDIRS = xkbcomp
-
-AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) $(XMALLOC_ZERO_CFLAGS)
-
-lib_LTLIBRARIES = libxkbcommon.la
-libxkbcommon_la_LIBADD = xkbcomp/libxkbcomp.la
-libxkbcommon_la_LDFLAGS = -no-undefined
-libxkbcommon_la_SOURCES = \
- XKBcommonint.h \
- alloc.c \
- atom.c \
- keysym.c \
- malloc.c \
- map.c \
- maprules.c \
- misc.c \
- state.c \
- text.c \
- utils.c \
- utils.h \
- xkb.c \
- xkballoc.h \
- xkbmisc.h \
- xkbrules.h
-
-BUILT_SOURCES = ks_tables.h
-CLEANFILES = $(BUILT_SOURCES)
-
-ks_tables.h: $(KEYSYMDEFS) $(top_builddir)/makekeys/makekeys$(EXEEXT)
- $(top_builddir)/makekeys/makekeys $(KEYSYMDEFS) > $@
diff --git a/src/xkbcomp/Makefile.am b/src/xkbcomp/Makefile.am
deleted file mode 100644
index 473f94d..0000000
--- a/src/xkbcomp/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src
-AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) \
- -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"'
-AM_YFLAGS = -d
-
-noinst_LTLIBRARIES = libxkbcomp.la
-libxkbcomp_la_SOURCES = \
- action.c \
- action.h \
- alias.c \
- alias.h \
- compat.c \
- expr.c \
- expr.h \
- indicators.c \
- indicators.h \
- keycodes.c \
- keycodes.h \
- keymap.c \
- keytypes.c \
- misc.c \
- misc.h \
- parseutils.c \
- parseutils.h \
- symbols.c \
- vmod.c \
- vmod.h \
- xkbcomp.c \
- xkbcomp.h \
- xkbparse.y \
- xkbpath.c \
- xkbpath.h \
- xkbscan.l
-
-BUILT_SOURCES = xkbparse.h
diff --git a/test/Makefile.am b/test/Makefile.am
index efe11cb..1f9d537 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,6 +1,6 @@
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src
-AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS)
-LDADD = $(top_builddir)/src/libxkbcommon.la
+AM_CFLAGS = $(X11_CFLAGS) $(XORG_COMPILER_FLAGS)
+LDADD = $(top_builddir)/libxkbcommon.la
TESTS_ENVIRONMENT = $(SHELL)