projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ec474bb
)
ugly awk workaround for random newlines inserted by gcc -E
author
Szabolcs Nagy
<nsz@port70.net>
Fri, 1 Jul 2016 21:03:39 +0000
(21:03 +0000)
committer
Szabolcs Nagy
<nsz@port70.net>
Fri, 1 Jul 2016 21:03:39 +0000
(21:03 +0000)
Makefile
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index
0cd8a1f
..
0942e91
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-5,7
+5,7
@@
LOBJS:=$(SRCS:src/%.c=$(B)/%.lo)
DIRS:=$(patsubst src/%/,%,$(sort $(dir $(SRCS))))
BDIRS:=$(DIRS:%=$(B)/%)
NAMES:=$(SRCS:src/%.c=%)
DIRS:=$(patsubst src/%/,%,$(sort $(dir $(SRCS))))
BDIRS:=$(DIRS:%=$(B)/%)
NAMES:=$(SRCS:src/%.c=%)
-CFLAGS:=-I
src/common -I$(B)
/common
+CFLAGS:=-I
$(B)/common -Isrc
/common
LDLIBS:=$(B)/common/libtest.a
AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
LDLIBS:=$(B)/common/libtest.a
AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
@@
-102,7
+102,12
@@
$(BDIRS):
mkdir -p $@
$(B)/common/options.h: src/common/options.h.in
mkdir -p $@
$(B)/common/options.h: src/common/options.h.in
- $(CC) -E - <$< | sed -e '1,/optiongroups_unistd_end/d' -e '/^#/d' -e '/^[[:space:]]*$$/d' -e 's/^/#define /' >$@
+ $(CC) -E - <$< | awk ' \
+ /optiongroups_unistd_end/ {s=1; next} \
+ !s || !NF || /^#/ {next} \
+ !a {a=$$1; if(NF==1)next} \
+ {print "#define "a" "$$NF; a=""}' >$@.tmp
+ mv $@.tmp $@
$(B)/common/mtest.o: src/common/mtest.h
$(math.OBJS): src/common/mtest.h
$(B)/common/mtest.o: src/common/mtest.h
$(math.OBJS): src/common/mtest.h