aboutsummaryrefslogtreecommitdiff
path: root/gcc/Makefile.in
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2024-01-04 09:36:28 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2024-01-04 09:36:28 -0500
commit6ecc1e32353e331137647a65a611eeb01b22184c (patch)
treeb8c38faaf78bd30663e798d5583b7788bb862e73 /gcc/Makefile.in
parent5bb18475a10d05d2aebf37db73ebf36c6912104d (diff)
downloadgcc-6ecc1e32353e331137647a65a611eeb01b22184c.zip
gcc-6ecc1e32353e331137647a65a611eeb01b22184c.tar.gz
gcc-6ecc1e32353e331137647a65a611eeb01b22184c.tar.bz2
opts: add logic to generate options-urls.cc
Changed in v2: - split out from the code that uses this - now handles lang-specific URLs, as well as generic URLs - the generated options-urls.cc now contains a function with a switch statement, rather than an array, to support lang-specific URLs: const char * get_opt_url_suffix (int option_index, unsigned lang_mask) { switch (option_index) { [...snip...] case OPT_B: if (lang_mask & CL_D) return "gdc/Directory-Options.html#index-B"; return "gcc/Directory-Options.html#index-B"; [...snip...] return nullptr; } gcc/ChangeLog: * Makefile.in (ALL_OPT_URL_FILES): New. (GCC_OBJS): Add options-urls.o. (OBJS): Likewise. (OBJS-libcommon): Likewise. (s-options): Depend on $(ALL_OPT_URL_FILES), and add this to inputs to opt-gather.awk. (options-urls.cc): New Makefile target. * opt-functions.awk (url_suffix): New function. (lang_url_suffix): New function. * options-urls-cc-gen.awk: New file. * opts.h (get_opt_url_suffix): New decl. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/Makefile.in')
-rw-r--r--gcc/Makefile.in18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 935ee4b..deb12e1 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1273,6 +1273,8 @@ FLAGS_TO_PASS = \
# All option source files
ALL_OPT_FILES=$(lang_opt_files) $(extra_opt_files)
+ALL_OPT_URL_FILES=$(patsubst %, %.urls, $(ALL_OPT_FILES))
+
# Target specific, C specific object file
C_TARGET_OBJS=@c_target_objs@
@@ -1289,7 +1291,7 @@ FORTRAN_TARGET_OBJS=@fortran_target_objs@
RUST_TARGET_OBJS=@rust_target_objs@
# Object files for gcc many-languages driver.
-GCC_OBJS = gcc.o gcc-main.o ggc-none.o gcc-urlifier.o
+GCC_OBJS = gcc.o gcc-main.o ggc-none.o gcc-urlifier.o options-urls.o
c-family-warn = $(STRICT_WARN)
@@ -1612,6 +1614,7 @@ OBJS = \
optinfo.o \
optinfo-emit-json.o \
options-save.o \
+ options-urls.o \
opts-global.o \
ordered-hash-map-tests.o \
passes.o \
@@ -1838,7 +1841,8 @@ OBJS-libcommon = diagnostic-spec.o diagnostic.o diagnostic-color.o \
# compiler and containing target-dependent code.
OBJS-libcommon-target = $(common_out_object_file) prefix.o \
opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
- hash-table.o file-find.o spellcheck.o selftest.o opt-suggestions.o
+ hash-table.o file-find.o spellcheck.o selftest.o opt-suggestions.o \
+ options-urls.o
# This lists all host objects for the front ends.
ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
@@ -2441,9 +2445,9 @@ s-specs : Makefile
$(STAMP) s-specs
optionlist: s-options ; @true
-s-options: $(ALL_OPT_FILES) Makefile $(srcdir)/opt-gather.awk
+s-options: $(ALL_OPT_FILES) $(ALL_OPT_URL_FILES) Makefile $(srcdir)/opt-gather.awk
LC_ALL=C ; export LC_ALL ; \
- $(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) > tmp-optionlist
+ $(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) $(ALL_OPT_URL_FILES) > tmp-optionlist
$(SHELL) $(srcdir)/../move-if-change tmp-optionlist optionlist
$(STAMP) s-options
@@ -2459,6 +2463,12 @@ options-save.cc: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
-f $(srcdir)/optc-save-gen.awk \
-v header_name="config.h system.h coretypes.h tm.h" < $< > $@
+options-urls.cc: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
+ $(srcdir)/options-urls-cc-gen.awk
+ $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
+ -f $(srcdir)/options-urls-cc-gen.awk \
+ -v header_name="config.h system.h coretypes.h tm.h" < $< > $@
+
options.h: s-options-h ; @true
s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
$(srcdir)/opth-gen.awk