⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267424 in webkit


Ignore:
Timestamp:
Sep 22, 2020, 11:37:51 AM (6 years ago)
Author:
Keith Rollin
Message:

Refactor build rules in Makefiles and Makefile.shared
https://bugs.webkit.org/show_bug.cgi?id=216806
<rdar://problem/69332316>

Reviewed by David Kilzer.

Factor out the common aspects of the build rules in Makefile.shared
and the various Makefiles. This allows us to more easily see what's
different between the various build targets, and to apply uniform
changes across all of the targets.

  • Makefile:

.:

  • Makefile.shared:
  • Source/Makefile:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r267416 r267424  
     12020-09-22  Keith Rollin  <krollin@apple.com>
     2
     3        Refactor build rules in Makefiles and Makefile.shared
     4        https://bugs.webkit.org/show_bug.cgi?id=216806
     5        <rdar://problem/69332316>
     6
     7        Reviewed by David Kilzer.
     8
     9        Factor out the common aspects of the build rules in Makefile.shared
     10        and the various Makefiles. This allows us to more easily see what's
     11        different between the various build targets, and to apply uniform
     12        changes across all of the targets.
     13
     14        * Makefile:
     15        * Makefile.shared:
     16        * Source/Makefile:
     17
    1182020-09-22  Jonathan Bedard  <jbedard@apple.com>
    219
  • trunk/Makefile

    r254227 r267424  
    11MODULES = WebKitLibraries Source Tools
    22
     3define build_target_for_each_module
     4        for dir in $(MODULES); do \
     5                ${MAKE} $@ -C $$dir PATH_FROM_ROOT=$(PATH_FROM_ROOT)/$${dir}; \
     6                exit_status=$$?; \
     7                [ $$exit_status -ne 0 ] && exit $$exit_status; \
     8        done; true
     9endef
     10
    311all:
    4         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    5         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     12        @$(build_target_for_each_module)
    613
    714debug d:
    8         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    9         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     15        @$(build_target_for_each_module)
    1016
    1117release r:
    12         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    13         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     18        @$(build_target_for_each_module)
    1419
    1520release+assert ra:
    16         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    17         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     21        @$(build_target_for_each_module)
    1822
    1923testing t:
    20         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    21         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     24        @$(build_target_for_each_module)
    2225
    2326analyze:
    24         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    25         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     27        @$(build_target_for_each_module)
    2628
    2729clean:
    28         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    29         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     30        @$(build_target_for_each_module)
  • trunk/Makefile.shared

    r267130 r267424  
    11SCRIPTS_PATH ?= ../Tools/Scripts
    22
    3 SET_COLOR_DIAGNOSTICS_ARG = if [[ -t 1 ]]; then COLOR_DIAGNOSTICS_ARG="COLOR_DIAGNOSTICS=YES"; fi
    43XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()' -- $(BUILD_WEBKIT_OPTIONS)` $${COLOR_DIAGNOSTICS_ARG} $(ARGS)
    54
     
    9392export PATH = $(shell getconf PATH)
    9493
    95 all: set_sanitizer_configuration
    96         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     94
     95define set_webkit_configuration
     96        $(SCRIPTS_PATH)/set-webkit-configuration $1 $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION)
     97endef
     98
     99define invoke_xcode
     100        ( \
     101                [[ -t 1 ]] && COLOR_DIAGNOSTICS_ARG="COLOR_DIAGNOSTICS=YES"; \
     102                $1 xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) $2 | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} \
     103        )
     104endef
     105
     106all:
     107        @$(call set_webkit_configuration,)
     108        @$(call invoke_xcode,,GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)')
    97109
    98110debug d development dev develop: force
    99         $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION)
    100         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     111        @$(call set_webkit_configuration,--debug)
     112        @$(call invoke_xcode,,GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)')
    101113
    102114release r deployment dep deploy: force
    103         $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION)
    104         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     115        @$(call set_webkit_configuration,--release)
     116        @$(call invoke_xcode,,GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)')
    105117
    106118release+assert ra: force
    107         $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION)
    108         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) ASSERT_ENABLED=1 $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     119        @$(call set_webkit_configuration,--release)
     120        @$(call invoke_xcode,,GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) ASSERT_ENABLED=1 $$(inherited)')
    109121
    110122testing t: force
    111         $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION) --force-optimization-level=O3
    112         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     123        @$(call set_webkit_configuration,--debug --force-optimization-level=O3)
     124        @$(call invoke_xcode,,GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)')
    113125
    114126analyze:
    115         $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(TSAN_OPTION) $(WK_LTO_OPTION)
     127        @$(call set_webkit_configuration,--debug)
    116128ifndef PATH_TO_SCAN_BUILD
    117         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     129        @$(call invoke_xcode,,GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' RUN_CLANG_STATIC_ANALYZER=YES)
    118130else
    119         ( $(SET_COLOR_DIAGNOSTICS_ARG); $(PATH_TO_SCAN_BUILD) xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)' | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
    120 endif
    121 
    122 set_sanitizer_configuration:
    123 ifneq (,$(ASAN_OPTION))
    124         $(SCRIPTS_PATH)/set-webkit-configuration $(ASAN_OPTION)
    125 endif
    126 ifneq (,$(TSAN_OPTION))
    127         $(SCRIPTS_PATH)/set-webkit-configuration $(TSAN_OPTION)
     131        @$(call invoke_xcode,$(PATH_TO_SCAN_BUILD),GCC_PREPROCESSOR_DEFINITIONS='$(GCC_PREPROCESSOR_ADDITIONS) $$(inherited)')
    128132endif
    129133
    130134clean:
    131         ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) -alltargets clean $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} )
     135        @$(call invoke_xcode,,-alltargets clean)
    132136
    133137force: ;
  • trunk/Source/Makefile

    r254227 r267424  
    1111MODULES = bmalloc WTF JavaScriptCore ThirdParty WebCore $(WEBINSPECTORUI_MODULE) WebKitLegacy WebKit
    1212
     13define build_target_for_each_module
     14        for dir in $(MODULES); do \
     15                ${MAKE} $@ -C $$dir PATH_FROM_ROOT=$(PATH_FROM_ROOT)/$${dir}; \
     16                exit_status=$$?; \
     17                [ $$exit_status -ne 0 ] && exit $$exit_status; \
     18        done; true
     19endef
     20
    1321all:
    14         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    15         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     22        @$(build_target_for_each_module)
    1623
    1724debug d:
    18         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    19         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     25        @$(build_target_for_each_module)
    2026
    2127release r:
    22         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    23         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     28        @$(build_target_for_each_module)
    2429
    2530release+assert ra:
    26         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    27         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     31        @$(build_target_for_each_module)
    2832
    2933testing t:
    30         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    31         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     34        @$(build_target_for_each_module)
    3235
    3336analyze:
    34         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    35         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     37        @$(build_target_for_each_module)
    3638
    3739clean:
    38         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    39         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     40        @$(build_target_for_each_module)
  • trunk/Source/ThirdParty/ChangeLog

    r265315 r267424  
     12020-09-22  Keith Rollin  <krollin@apple.com>
     2
     3        Refactor build rules in Makefiles and Makefile.shared
     4        https://bugs.webkit.org/show_bug.cgi?id=216806
     5        <rdar://problem/69332316>
     6
     7        Reviewed by David Kilzer.
     8
     9        Factor out the common aspects of the build rules in Makefile.shared
     10        and the various Makefiles. This allows us to more easily see what's
     11        different between the various build targets, and to apply uniform
     12        changes across all of the targets.
     13
     14        * Makefile:
     15
    1162020-08-05  Tim Horton  <timothy_horton@apple.com>
    217
  • trunk/Source/ThirdParty/Makefile

    r254227 r267424  
    2525MODULES = ANGLE $(LIBWEBRTC_MODULE)
    2626
     27define build_target_for_each_module
     28        for dir in $(MODULES); do \
     29                ${MAKE} $@ -C $$dir PATH_FROM_ROOT=$(PATH_FROM_ROOT)/$${dir}; \
     30                exit_status=$$?; \
     31                [ $$exit_status -ne 0 ] && exit $$exit_status; \
     32        done; true
     33endef
     34
    2735all:
    28         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    29         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     36        @$(build_target_for_each_module)
    3037
    3138debug d development dev develop:
    32         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    33         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     39        @$(build_target_for_each_module)
    3440
    3541release r deployment dep deploy:
    36         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    37         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     42        @$(build_target_for_each_module)
    3843
    3944release+assert ra:
    40         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    41         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     45        @$(build_target_for_each_module)
    4246
    4347testing t:
    44         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    45         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     48        @$(build_target_for_each_module)
    4649
    4750analyze:
    48         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    49         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     51        @$(build_target_for_each_module)
    5052
    5153clean:
    52         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    53         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     54        @$(build_target_for_each_module)
  • trunk/Tools/ChangeLog

    r267414 r267424  
     12020-09-22  Keith Rollin  <krollin@apple.com>
     2
     3        Refactor build rules in Makefiles and Makefile.shared
     4        https://bugs.webkit.org/show_bug.cgi?id=216806
     5        <rdar://problem/69332316>
     6
     7        Reviewed by David Kilzer.
     8
     9        Factor out the common aspects of the build rules in Makefile.shared
     10        and the various Makefiles. This allows us to more easily see what's
     11        different between the various build targets, and to apply uniform
     12        changes across all of the targets.
     13
     14        * Makefile:
     15
    1162020-09-22  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/Tools/Makefile

    r257161 r267424  
    2121endif
    2222
     23define build_target_for_each_module
     24        for dir in $(MODULES); do \
     25                ${MAKE} $@ -C $$dir PATH_FROM_ROOT=$(PATH_FROM_ROOT)/$${dir}; \
     26                exit_status=$$?; \
     27                [ $$exit_status -ne 0 ] && exit $$exit_status; \
     28        done; true
     29endef
     30
    2331all:
    24         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    25         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     32        @$(build_target_for_each_module)
    2633
    2734debug d development dev develop:
    28         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    29         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     35        @$(build_target_for_each_module)
    3036
    3137release r deployment dep deploy:
    32         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    33         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     38        @$(build_target_for_each_module)
    3439
    3540release+assert ra:
    36         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    37         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     41        @$(build_target_for_each_module)
    3842
    3943testing t:
    40         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    41         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     44        @$(build_target_for_each_module)
    4245
    4346analyze:
    44         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    45         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     47        @$(build_target_for_each_module)
    4648
    4749clean:
    48         @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
    49         if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
     50        @$(build_target_for_each_module)
Note: See TracChangeset for help on using the changeset viewer.