5 LOGFILE = $(top_builddir)/logfile
7 -LDFLAGS := $(shell cat LDFLAGS | grep -v \^\#)
8 +LDFLAGS := $(strip $(shell grep -sv '^\#' LDFLAGS))
9 +CFLAGS := $(strip $(shell grep -sv '^\#' CFLAGS))
10 +CPPFLAGS := $(strip $(shell grep -sv '^\#' CPPFLAGS))
12 RUN_TESTS := $(shell $(top_builddir)/locate-test \
13 --execs $(top_builddir)/$(POSIX_TARGET))
14 @@ -54,14 +56,19 @@ stress-tests: stress-make stress-run
16 $(MAKE) all | column -t -s:
18 -CFLAGS = -g -O2 -Wall -Werror -D_POSIX_C_SOURCE=200112L
22 +CFLAGS += -Wall -Werror
24 +CPPFLAGS = -D_POSIX_C_SOURCE=200112L
27 # add -std=c99, -std=gnu99 if compiler supports it (gcc-2.95.3 does not).
28 check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
29 -CFLAGS += $(call check_gcc,-std=c99,)
30 -CFLAGS += $(call check_gcc,-std=gnu99,)
31 +CFLAGS += $(call check_gcc,-std=gnu99,$(call check_gcc,-std=c99,))
34 +CPPFLAGS += -Iinclude
36 # FIXME: exaust cmd line length
38 @@ -165,7 +172,7 @@ $(top_builddir)/t0.val: $(top_builddir)/
41 @COMPLOG=$(LOGFILE).$$$$; \
42 - if $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ $(LDFLAGS) > $$COMPLOG 2>&1; \
43 + if $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ > $$COMPLOG 2>&1; \
45 echo "$(@:.o=): build: PASS" | tee -a $(LOGFILE); \
50 #This file contains all lines needed for linking the test suites.
51 #These may be on one line or multiple lines.
53 -#Place the -l, -L, or -D piece before the item to link.
54 +#Place the -l or -L pieces before the item to link.
55 #Lines beginning with # are comments.
58 -#-lpthread -D_GNU_SOURCE
62 #-D_XOPEN_SOURCE=600 -lpthread -lrt -lm
64 -# For use with Linux, you may try the following flags to
65 -# allow for the NPTL-specific compilation (used in some test cases)
66 -# Note: this sometimes require the package nptl-devel.*.rpm to be installed.
67 -#-I /usr/include/nptl -L /usr/lib/nptl -D_XOPEN_SOURCE=600 -lpthread -lrt -lm
71 +#This file contains all the preprocessor flags (such as defines and includes)
72 +#needed for compiling the test suites.
73 +#These may be on one line or multiple lines.
75 +#Lines beginning with # are comments.
78 +#-D_GNU_SOURCE -I/usr/include/nptl
85 +#This file contains all the optimizations/compiler settings
86 +#needed for compiling the test suites.
87 +#These may be on one line or multiple lines.
89 +#Lines beginning with # are comments.