aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-08-03 18:11:01 -0500
committerseebs <seebs@seebs-eee.(none)>2010-08-04 17:13:31 -0500
commit8bf7df7ee9360d5d1256498bd5e97d3c6bc387f6 (patch)
tree2351d384759d442b0dc5d9fe1b5bd048008ebb6c
parenta893df934c8362c9457d5fb92218885e5aa94647 (diff)
downloadpseudo-8bf7df7ee9360d5d1256498bd5e97d3c6bc387f6.tar.gz
pseudo-8bf7df7ee9360d5d1256498bd5e97d3c6bc387f6.tar.bz2
pseudo-8bf7df7ee9360d5d1256498bd5e97d3c6bc387f6.zip
Allow CFLAGS to be set in the environment.
CFLAGS is set by many autobuilder systems. In these environments we may need both the internal flags pseudo expects and the autobuilder flags. Adjust the Makefile accordingly. Based on code from Richard Purdie 2010-03-18 in Poky Linux. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-rw-r--r--ChangeLog.txt1
-rw-r--r--Makefile.in15
2 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 63f9996..b9c2654 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,5 +1,6 @@
2010-08-03:
* (mhatle) Fix parallel build problem
+ * (mhatle) allow both environment CFLAGS and internals CFLAGS
2010-07-30:
* (kscherer) added .gitignore file
diff --git a/Makefile.in b/Makefile.in
index 268fd4c..d616fd4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -37,7 +37,7 @@ CFLAGS_CODE=-fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE -m$(BITS)
CFLAGS_DEFS=-DPSEUDO_PREFIX='"$(PREFIX)"' -DPSEUDO_SUFFIX='"$(SUFFIX)"' -DPSEUDO_VERSION='"$(VERSION)"'
CFLAGS_DEBUG=-O2 -g
CFLAGS_SQL=-L$(SQLITE)/lib -I$(SQLITE)/include
-CFLAGS=$(CFLAGS_BASE) $(CFLAGS_CODE) $(CFLAGS_DEFS) \
+CFLAGS_PSEUDO=$(CFLAGS_BASE) $(CFLAGS_CODE) $(CFLAGS_DEFS) \
$(CFLAGS_DEBUG) $(CFLAGS_SQL)
GLOB_PATTERN=guts/*.c
@@ -78,23 +78,26 @@ $(BIN) $(LIB) $(LOCALSTATE):
mkdir -p $@
$(PSEUDO): $(BIN) pseudo.o $(SHOBJS) $(DBOBJS) pseudo_client.o pseudo_server.o pseudo_ipc.o
- $(CC) $(CFLAGS) -o $(PSEUDO) \
+ $(CC) $(CFLAGS) $(CFLAGS_PSEUDO) -o $(PSEUDO) \
pseudo.o pseudo_server.o pseudo_client.o pseudo_ipc.o \
$(DBOBJS) $(SHOBJS) $(DBLDFLAGS)
$(PSEUDOLOG): $(BIN) pseudolog.o $(SHOBJS) $(DBOBJS) pseudo_client.o pseudo_ipc.o
- $(CC) $(CFLAGS) -o $(PSEUDOLOG) pseudolog.o pseudo_client.o pseudo_ipc.o \
+ $(CC) $(CFLAGS) $(CFLAGS_PSEUDO) -o $(PSEUDOLOG) pseudolog.o pseudo_client.o pseudo_ipc.o \
$(DBOBJS) $(SHOBJS) $(DBLDFLAGS)
$(PSEUDODB): $(BIN) pseudodb.o $(SHOBJS) $(DBOBJS) pseudo_ipc.o
- $(CC) $(CFLAGS) -o $(PSEUDODB) pseudodb.o \
+ $(CC) $(CFLAGS) $(CFLAGS_PSEUDO) -o $(PSEUDODB) pseudodb.o \
$(DBOBJS) $(SHOBJS) $(DBLDFLAGS) pseudo_ipc.o
$(LIBPSEUDO): $(LIB) $(WRAPOBJS) pseudo_client.o pseudo_ipc.o $(SHOBJS)
- $(CC) $(CFLAGS) -shared -o $(LIBPSEUDO) \
+ $(CC) $(CFLAGS) $(CFLAGS_PSEUDO) -shared -o $(LIBPSEUDO) \
pseudo_client.o pseudo_ipc.o \
$(WRAPOBJS) $(SHOBJS) -ldl
+%.o: %.c
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(CFLAGS_PSEUDO) $<
+
pseudo_client.o pseudo_server.o pseudo_ipc.o: pseudo_ipc.h
pseudo_client.o: pseudo_client.h
@@ -110,7 +113,7 @@ pseudo_wrapfuncs.c pseudo_wrapfuncs.h: wrappers
# no-strict-aliasing is needed for the function pointer trickery.
pseudo_wrappers.o: $(GUTS) pseudo_wrappers.c pseudo_wrapfuncs.c pseudo_wrapfuncs.h
- $(CC) -fno-strict-aliasing $(CFLAGS) -D_GNU_SOURCE -c -o pseudo_wrappers.o pseudo_wrappers.c
+ $(CC) -fno-strict-aliasing $(CFLAGS) $(CFLAGS_PSEUDO) -D_GNU_SOURCE -c -o pseudo_wrappers.o pseudo_wrappers.c
offsets32:
$(CC) -m32 -o offsets32 offsets.c