[PATCH libxkbcommon 05/11] config: makekeys prog should stand alone in the makekeys directory

Gaetan Nadon memsize at videotron.ca
Sat Dec 11 17:08:34 PST 2010


This program is a utility to generated a header file.
The header file it generates should not be located in the
directory where this utility program is compiled.

Move the /makekeys dir as a sibling of /src.
This reduces the number of bi-directional relationships
between directories.

Make corresponding makefiles simplifications.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 Makefile.am                           |    3 ++-
 configure.ac                          |    2 +-
 makekeys/.gitignore                   |    1 +
 makekeys/Makefile.am                  |    5 +++++
 {src/makekeys => makekeys}/makekeys.c |    0
 src/.gitignore                        |    1 +
 src/Makefile.am                       |   10 ++++++++--
 src/makekeys/.gitignore               |    2 --
 src/makekeys/Makefile.am              |   13 -------------
 9 files changed, 18 insertions(+), 19 deletions(-)
 create mode 100644 makekeys/.gitignore
 create mode 100644 makekeys/Makefile.am
 rename {src/makekeys => makekeys}/makekeys.c (100%)
 create mode 100644 src/.gitignore
 delete mode 100644 src/makekeys/.gitignore
 delete mode 100644 src/makekeys/Makefile.am

diff --git a/Makefile.am b/Makefile.am
index 4ad18e7..2a4d448 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
-SUBDIRS = include src test
+# Order: makekeys before src
+SUBDIRS = include makekeys src test
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = xkbcommon.pc
diff --git a/configure.ac b/configure.ac
index 7f8f9fa..f8175ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,8 +99,8 @@ AC_CONFIG_FILES([
 	Makefile
 	xkbcommon.pc
 	include/Makefile
+	makekeys/Makefile
 	src/Makefile
-	src/makekeys/Makefile
 	src/xkbcomp/Makefile
 	test/Makefile])
 AC_OUTPUT
diff --git a/makekeys/.gitignore b/makekeys/.gitignore
new file mode 100644
index 0000000..2bdb5e0
--- /dev/null
+++ b/makekeys/.gitignore
@@ -0,0 +1 @@
+makekeys
diff --git a/makekeys/Makefile.am b/makekeys/Makefile.am
new file mode 100644
index 0000000..75ed164
--- /dev/null
+++ b/makekeys/Makefile.am
@@ -0,0 +1,5 @@
+AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS)
+
+# need to use build-native compiler
+CC = $(CC_FOR_BUILD)
+noinst_PROGRAMS = makekeys
diff --git a/src/makekeys/makekeys.c b/makekeys/makekeys.c
similarity index 100%
rename from src/makekeys/makekeys.c
rename to makekeys/makekeys.c
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..fe11434
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1 @@
+ks_tables.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 7ae10de..9a77ece 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
-SUBDIRS = makekeys xkbcomp
+SUBDIRS = xkbcomp
 
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(builddir)/makekeys
+AM_CPPFLAGS = -I$(top_srcdir)/include
 AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) $(XMALLOC_ZERO_CFLAGS)
 
 lib_LTLIBRARIES = libxkbcommon.la
@@ -22,3 +22,9 @@ libxkbcommon_la_SOURCES = \
 	xkbgeom.h \
 	xkbmisc.h \
 	xkbrules.h
+
+BUILT_SOURCES = ks_tables.h
+CLEANFILES = $(BUILT_SOURCES)
+
+ks_tables.h: $(top_builddir)/makekeys/makekeys$(EXEEXT)
+	$(AM_V_GEN)cat $(KEYSYMDEF_H) $(XF86KEYSYM_H) | $(top_builddir)/makekeys/makekeys$(EXEEXT) > $@
diff --git a/src/makekeys/.gitignore b/src/makekeys/.gitignore
deleted file mode 100644
index 6251fb4..0000000
--- a/src/makekeys/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-ks_tables.h
-makekeys
diff --git a/src/makekeys/Makefile.am b/src/makekeys/Makefile.am
deleted file mode 100644
index 1847034..0000000
--- a/src/makekeys/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS)
-
-# 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 $(KEYSYMDEF_H) $(XF86KEYSYM_H) | $(builddir)/makekeys$(EXEEXT) > $@
-- 
1.6.0.4



More information about the xorg-devel mailing list