summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorherbert <herbert@gondor.apana.org.au>2005-03-25 18:09:43 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2005-09-26 18:33:04 +1000
commit7f869bf1061a2206424c9436b4d40f4821bef306 (patch)
treed3c2f1c720baedc5af48e8d6d5f5bda66be243cb /src
parentFixed support for cross-compilation. (diff)
downloaddash-7f869bf1061a2206424c9436b4d40f4821bef306.tar.gz
dash-7f869bf1061a2206424c9436b4d40f4821bef306.zip
Cleaned up src/Makefile.am.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am19
1 files changed, 14 insertions, 5 deletions
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 $@ $<