summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--src/Makefile.am19
2 files changed, 16 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3d2e0fa..3d4412b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+	* Cleaned up src/Makefile.am.
+
 2005-03-25  Gilles Chanteperdrix <gilles.chanteperdrix@laposte.net>
 
 	* Fixed support for cross-compilation.
diff --git a/src/Makefile.am b/src/Makefile.am
index b0d909c..1675d9f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,14 +1,23 @@
 # $Id$
 
-AM_CPPFLAGS = -include $(top_builddir)/config.h
 AM_YFLAGS = -d
 
-AM_CFLAGS = -g -O2 -Wall
-DEFS = \
+COMMON_CFLAGS = -g -O2 -Wall
+COMMON_CPPFLAGS = \
+	-include $(top_builddir)/config.h \
 	-DBSD=1 -DSMALL -DSHELL \
 	-DGLOB_BROKEN -DFNMATCH_BROKEN -DIFS_BROKEN \
 	-D__COPYRIGHT\(x\)= -D__RCSID\(x\)= -D_DIAGASSERT\(x\)=
 
+AM_CFLAGS = $(COMMON_CFLAGS)
+AM_CPPFLAGS = $(COMMON_CPPFLAGS)
+AM_CFLAGS_FOR_BUILD = $(COMMON_CFLAGS) 
+AM_CPPFLAGS_FOR_BUILD = $(COMMON_CPPFLAGS)
+
+COMPILE_FOR_BUILD = \
+	$(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) \
+	$(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) 
+
 bin_PROGRAMS = dash
 
 dash_CFILES = \
@@ -29,7 +38,7 @@ HELPERS = mkinit mksyntax mknodes mksignames
 BUILT_SOURCES = arith.h builtins.h nodes.h syntax.h token.h
 CLEANFILES = \
 	$(BUILT_SOURCES) $(patsubst %.o,%.c,$(dash_LDADD)) \
-	arith.c mkinit mknodes mksignames mksyntax
+	arith.c $(HELPERS)
 
 man_MANS = dash.1
 EXTRA_DIST = \
@@ -56,4 +65,4 @@ signames.c: mksignames
 	./$^
 
 $(HELPERS): %: %.c
-	$(CC_FOR_BUILD) -o $@ $<
+	$(COMPILE_FOR_BUILD) -o $@ $<