Move ks_tables.h build into makekeys subdirectory
authorDan Nicholson <dbn.lists@gmail.com>
Thu, 26 Mar 2009 13:50:33 +0000 (06:50 -0700)
committerDan Nicholson <dbn.lists@gmail.com>
Fri, 27 Mar 2009 13:46:32 +0000 (06:46 -0700)
This avoids the BUILT_SOURCES weirdness and forcing the build into the
makekeys subdirectory. Added a new make variable KS_HEADERS that lists
all the keysym headers we're going to parse.

configure.ac
src/Makefile.am
src/makekeys/Makefile.am

index b03baa4..652fbf4 100644 (file)
@@ -67,6 +67,8 @@ test -f "$XF86KEYSYM_H" || AC_MSG_ERROR([can't locate XF86keysym.h in $x11includ
 AC_MSG_RESULT([$XF86KEYSYM_H])
 AC_SUBST([XF86KEYSYM_H])
 
 AC_MSG_RESULT([$XF86KEYSYM_H])
 AC_SUBST([XF86KEYSYM_H])
 
+AC_SUBST([KS_HEADERS], ['$(KEYSYMDEF_H) $(XF86KEYSYM_H)'])
+
 # Require xorg-macros version 1.2.0 or newer for XORG_CHANGELOG macro
 m4_ifndef([XORG_MACROS_VERSION],
     [m4_fatal([must install xorg-macros before running autoconf/autogen.sh])])
 # Require xorg-macros version 1.2.0 or newer for XORG_CHANGELOG macro
 m4_ifndef([XORG_MACROS_VERSION],
     [m4_fatal([must install xorg-macros before running autoconf/autogen.sh])])
index ab944a2..72c29af 100644 (file)
@@ -1,21 +1,11 @@
 SUBDIRS = makekeys
 
 SUBDIRS = makekeys
 
-INCLUDES = -I$(top_srcdir)/include
+INCLUDES = -I$(top_srcdir)/include -I$(builddir)/makekeys
 AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) $(XMALLOC_ZERO_CFLAGS)
 
 AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) $(XMALLOC_ZERO_CFLAGS)
 
-BUILT_SOURCES = ks_tables.h
-ks_tables.h: $(builddir)/makekeys/makekeys$(EXEEXT)
-       @rm -f $@
-       cat $(KEYSYMDEF_H) $(XF86KEYSYM_H) | \
-         $(builddir)/makekeys/makekeys$(EXEEXT) >$@
-
-$(builddir)/makekeys/makekeys$(EXEEXT):
-       @cd makekeys && $(MAKE) $(AM_MAKEFLAGS)
-
 lib_LTLIBRARIES = libxkbcommon.la
 libxkbcommon_la_SOURCES = \
        XKBcommonint.h \
 lib_LTLIBRARIES = libxkbcommon.la
 libxkbcommon_la_SOURCES = \
        XKBcommonint.h \
-       ks_tables.h \
        alloc.c \
        galloc.c \
        atom.c \
        alloc.c \
        galloc.c \
        atom.c \
index bd05903..781723c 100644 (file)
@@ -4,3 +4,10 @@ AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS)
 # need to use build-native compiler
 CC = $(CC_FOR_BUILD)
 noinst_PROGRAMS = makekeys
 # need to use build-native compiler
 CC = $(CC_FOR_BUILD)
 noinst_PROGRAMS = makekeys
+
+nodist_noinst_HEADERS = ks_tables.h
+CLEANFILES = ks_tables.h
+
+ks_tables.h: makekeys$(EXEEXT)
+       @rm -f $@
+       cat $(KS_HEADERS) | $(builddir)/makekeys$(EXEEXT) > $@