summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Ericsson <ae@op5.se>2008-11-22 15:35:31 +0100
committerShawn O. Pearce <spearce@spearce.org>2008-11-22 12:08:00 -0800
commitab3f234e5f33426172ecead8d964b927bb281850 (patch)
treee58c5633474c35eb16f9dec209d57aaf881b97cc
parent6013ffa66ef5d856b2c4c72c44b1a63a7ccc2b57 (diff)
downloadlibgit2-ab3f234e5f33426172ecead8d964b927bb281850.tar.gz
Make using CFLAGS a bit simpler
This patch introduces the $(ALL_CFLAGS) variable, which holds $(BASIC_CFLAGS) as well as userdefined $(CFLAGS) and then consistently uses that variable where both were used anyway. Since we're in the area, we optimize the sparse running a bit, getting rid of the shell and just letting sparse iterate over the files. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rw-r--r--Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index e7bed373b..71628d165 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,7 @@ OS = unix
BASIC_CFLAGS := -Isrc
BASIC_CFLAGS += -fvisibility=hidden
+ALL_CFLAGS = $(CFLAGS) $(BASIC_CFLAGS)
SRC_C = $(wildcard src/*.c)
OBJS = $(patsubst %.c,%.o,$(SRC_C))
@@ -42,14 +43,14 @@ apidocs:
test: $(TEST_RUN)
sparse: $(CONFIG_H)
- @for i in $(SRC_C); do sparse $$i -DSPARSE_IS_RUNNING $(SPARSE_FLAGS) $(BASIC_CFLAGS) $(CFLAGS); done
+ sparse -DSPARSE_IS_RUNNING $(ALL_CFLAGS) $(SPARSE_FLAGS) $(SRC_C)
install-headers: $(PUBLIC_HEADERS)
@mkdir -p /tmp/gitinc/git
@for i in $^; do cat .HEADER $$i > /tmp/gitinc/$${i##src/}; done
.c.o:
- $(CC) $(BASIC_CFLAGS) $(CFLAGS) -c $< -o $@
+ $(CC) $(ALL_CFLAGS) -c $< -o $@
$(CONFIG_H): $(CONFIG_H).in
sed 's/@@OS@@/$(OS)/g' $< >$@+
@@ -72,7 +73,7 @@ $(patsubst %.exe,%.toc,$(TEST_EXE)): tests/%.toc: tests/%.c
mv $@+ $@
$(TEST_OBJ): tests/%.o: tests/%.c
- $(CC) -Isrc $(CFLAGS) -c $< -o $@
+ $(CC) $(ALL_CFLAGS) -c $< -o $@
$(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: $(HDRS)
$(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: $(T_MAIN_C)