parser option handling

Bernhard Fischer <[email protected]> Sat, 5 May 2007 14:58:03 +0200
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
Hi,

With synopsis off the 0_8 branch, i used these rules to create a
cross-reference (see busybox.net, svn trunk for the whole "testcase"):

syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs)))
syn     = $(patsubst %.c, %.syn, $(syn_tgt))

comma:= ,
brace_open:= (
brace_close:= )

SYN_CPPFLAGS := $(strip $(CPPFLAGS) $(EXTRA_CPPFLAGS))
SYN_CPPFLAGS := $(subst $(brace_open),\$(brace_open),$(SYN_CPPFLAGS))
SYN_CPPFLAGS := $(subst $(brace_close),\$(brace_close),$(SYN_CPPFLAGS))

%.syn: %.c
        synopsis -p C -l Comments.SSDFilter,Comments.Previous \
		-Wp,preprocess=True,cppflags="'$(SYN_CPPFLAGS)'" -o $@ $<

.PHONY: html
html: $(syn)
        synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^


The SYN_CPPFLAGS evaluate to:
-std=gnu99 -Iinclude -Ilibbb -I/home/cow/src/busybox_trunk/libbb
-include include/autoconf.h -D_GNU_SOURCE -DNDEBUG -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-D"BB_VER=KBUILD_STR\(1.6.0.svn\)" -DBB_BT=AUTOCONF_TIMESTAMP

This works satisfactorily well with the 0_8 branch.
Now, with trunk, I'm facing a few issues:

1) -std=gnu99
is currently not accepted but would influence the Cpp behaviour.

2) -include
is currently rejected, only --include is accepted.
This is, from the looks, merely a getopt-imposed misfeature.