1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00
Commit graph

58 commits

Author SHA1 Message Date
Torbjörn Svensson
2a669100f0 Bug 577263: CommandGenerator not respected for option value type libs
Contributed by STMicroelectronics

Change-Id: I2c332eb40b6b69aff405c2c7c86cdcd4acaf5d19
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
Also-By: Erik Hentschke <erik.hentschke@bachmann.info>
Also-By: John Dallaway <john@dallaway.org.uk>
2022-05-04 12:45:27 -04:00
Christian Walther
f138ad10e8 Bug 575490: "No rule" after removing last source file from root
Include the top-level subdir.mk only when one was actually generated
(i.e. when there are source files there), just like for all other
subdir.mk, otherwise a stale one from earlier when there were source
files that have since been removed may be picked up, causing "No rule to
make target" errors.

In some cases (from bug 303953), the removal would be noticed and the
stale subdir.mk be overwritten by a correct empty one, avoiding the
error, but not in the following cases:
- When CommonBuilder.performCleanning() decides that a full rebuild is
needed, regenerateMakefiles() is called instead of generateMakefiles(),
which doesn't get the delta.
- When the refresh in which Eclipse notices the removed source file
happens as part of a build (one that probably failed because the
makefiles weren't updated yet), the next build after that apparently
does not get the delta containing the removal anymore.

Change-Id: Id15b424f02dd5c513d2124620c0c8699d61874fd
Signed-off-by: Christian Walther <walther@indel.ch>
2021-11-02 12:45:10 +01:00
Christian Walther
3afae27158 Bug 575702: Nondeterministic makefile ordering
Several parts of makefile output were generated by iterating over
HashMaps, which do not have a deterministic iteration order. Use
TreeMaps instead to output in sorted order. This is possible now that
the API function with return type HashMap is no longer public API and
can be changed to return Map instead.

Benchmark files for affected tests are updated to the new ordering.
This would not be strictly necessary: the tests would also succeed
without, since org.eclipse.cdt.managedbuilder.testplugin.
ManagedBuildTestHelper.compareMakefiles() uses a reordering-tolerant
comparison. However, recording the new (now hopefully stable) order
makes future development on makefile generation easier by avoiding
spurious diff output when tests fail due to changes to other parts of
makefiles.

Change-Id: I20f2e51bd5b9e3bcc5da245d781ca5b4a34fc0b2
Signed-off-by: Christian Walther <walther@indel.ch>
2021-11-02 10:47:17 +01:00
Christian Walther
32a6ad1f4d Bug 575702: Nondeterministic makefile ordering (prelude)
This fixes a small and rarely hit in practice regression regarding
nondeterministic ordering in makefile output introduced in 15c29eb (bug
505882).

Multiple values for a build output variable were previously output in
definition order. Now they are generated by iterating over a HashSet,
which does not have a deterministic iteration order. Use a TreeSet for
output in a consistently sorted order instead.

Output variables with multiple values are rare (most tools generate one
output file of a particular type) and this case was not exercised in the
existing unit tests. Modify one such that it does (even if in a somewhat
contrived situation). Of note, ${OUTPUT} cannot be used in the
commandLinePattern for such a tool because it squashes the multiple
values into a single quoted file name - misuse ${FLAGS} instead.

Change-Id: Iaa28525c21d74c87dd4d72a03e334ed0e5576727
Signed-off-by: Christian Walther <walther@indel.ch>
2021-11-02 10:40:32 +01:00
Torbjörn Svensson
15c29ebf2c Bug 505882: Generate clean target per subdir.mk
To avoid errors like "Command line too long" when removing build
artifacts, split the clean command on multiple lines. In order to
properly handle whitespace etc, generate a new clean target in each
subdir.mk with the explicit list of files to remove in that directory.
The command should be splited on a sane length, 6000 is used in the
internal builder, so reuse that limit here.

Contributed by STMicroelectronics

Change-Id: I843e1ac896076d279173c421210b72f4a325296f
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2021-10-20 13:56:36 -04:00
Christian Walther
ce521345e0 Bug 574741: Always add main-build to .PHONY.
Addendum to 0436516 (Bug 573502): The main-build target now always
exists, not just when there is a pre-build step, so it must always be
marked as .PHONY.

Change-Id: I478222bcc319c516a6e116f710d8382346b5ded5
Signed-off-by: Christian Walther <walther@indel.ch>
2021-07-08 16:11:59 +02:00
Torbjörn Svensson
043651694a Bug 573502: Ensure post-build step is executed last
The post-build step may depend on secondary artifacts of the build and
should thus be executed last.

Contributed by STMicroelectronics

Change-Id: Iaf67f6b3e1fcab008798d2712e15d0a6a46ceae8
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2021-05-14 18:35:54 -04:00
Torbjörn SVENSSON
c809bde381 Bug 571384: Rebuild required files when configuration has changed
A change of build configuration should rebuild the artifact.
With make, this is achieved by depending on the makefile that contains
the rule to build the artifact. If the flags change, so will the
makefile do and the artifact is rebuilt.

Contributed by STMicroelectronics

Change-Id: I56e0376ff9bfa5629b55c1b6c9f94a6f930e0d69
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
2021-02-22 14:53:52 -05:00
Torbjörn SVENSSON
b063af68ad Bug 571405: Generate rules with -MT"$@"
When there is a linked file in the project, the build target for the
content in the .d file should be the .o file as that is what is
depending on the source file.

Use "$@" rather than "$(@)" as it's the usual syntax for single letter
variables in make.

Contributed by STMicroelectronics

Change-Id: I6b024b2b3a1a8b061740e99de5e96923981c92fa
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
2021-02-22 14:35:58 -05:00
Torbjörn SVENSSON
07d8edaf28 Bug 571381: Generate BUILD_ARTIFACT* symbols in makefile
The symbols generated are:
* BUILD_ARTIFACT_NAME
  Value of "Artifact name" field defined in the build configuration
* BUILD_ARTIFACT_EXTENSION
  Value of "Artifact extension" field defined in the build configuration
* BUILD_ARTIFACT_PREFIX
  Value of "Output prefix" field defined in the build configuration
* BUILD_ARTIFACT
  Assembly of the other values to build the target file name

The above symbols make it easier to extend the generated makefile using
the provided makefile hooks "makefile.init", "makefile.defs" and
"makefile.targets". There is no longer need to duplicate the name of
the target artifact in the hooks files.
The hooks can for example be used when the post-build step is not
flexible enough. By placing the post-build step in makefile.targets,
when done properly, will let the user have full control over the
sequence, including parallelism, for the required steps.

Contributed by STMicroelectronics

Change-Id: I163917837b65cb397eb5943c4357a54e9576cf42
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
2021-02-20 15:22:22 +01:00
Jonah Graham
f70a8b35c1 Bug 540371: Update to EPLv2 using releng/scripts/change_to_eplv2.sh
Change-Id: Ifbb1d5af2a00bd5634dea200320e8c4303ffca6c
2018-11-22 20:31:51 +00:00
Jonah Graham
7f8440b6b2 Bug 516813: don't mark all targets as secondary
Change-Id: I9da30b0504f1f89e927b9f735fc98a09bfea08b5
2017-05-17 14:34:09 +01:00
Morten Kristiansen
10428dd53a [Bug 340300] Fix parallel make when using pre-build steps
Pre-build will always run in parallel to compilation of source files
unless each and every source file depends on pre-build. Also, when
parallel build was enabled, the "Make build target" under "Workbench
Build Behavior" was ignored. Instead of doing make -j all, Eclipse ran
make -j pre-build main-build. While the intentions are good, make will
attempt to build pre-build and main-build in parallel for previous
stated reasons.

This patch changes two things:

1. Eclipse will consistently respect the "Workbench Build Behavior" for
both single- and multi-process build.
2. The generated makefile is changed to guarantee pre-build is run
first.

   Changed from

       all: pre-build main-build

   to

       all:
           $(MAKE) --no-print-directory pre-build
           $(MAKE) --no-print-directory main-build

Change-Id: Icf3a1057ee3b3cc8a04a433820492a4f469e17dd
Signed-off-by: Morten Kristiansen <millibit@gmail.com>
2017-01-03 08:26:18 -04:00
ocagdas
6ab4145c56 Bug 468417
The '.d' files that are generated by CDT, contain 'file_name.d:
file_name.cpp file_name.h' type of target prerequisite relations. 

However, to get benefit of the dependency mechanism, this should be
something like 'file_name.o: file_name.cpp file_name.h'.

Therefore, we need to change ''options[3] = "-MT\"$(@:%.o=%.d)\"";'' as
'options[3] = "-MT\"$(@)\"";'

Also update the test cases.

Change-Id: Iee829a8564e1b134905ee06a8a4b76a1e3b30ecc
Signed-off-by: ocagdas <ocagdas@yahoo.com>
2015-06-24 21:54:00 -04:00
Marc Khouzam
79ff9f136c Change output to fix failing tests.
The cause of the different output is a change in o.e.core.resources
where the order of visiting a project has changed to become
alphabetical.  See 
http://eclip.se/461838

Therefore, our benchmark files must also have the output of
subdirectories in alphabetical order.

Change-Id: I3331649cf516adbe3b453b11f1ed6733a007ce4d
2015-05-08 09:04:37 -04:00
Andrew Gvozdev
6bbc31c7a2 bug 312835: CDT build settings which are set at the folder level are
ignored in certain situations - restored reverse sorting plus
unit tests adjusted
2011-07-02 02:25:38 -04:00
Andrew Gvozdev
c1d17327f3 bug 232373: cdt generated make file has options with no spaces between option and argument 2010-10-24 04:06:38 +00:00
Andrew Gvozdev
107aabe04c bug 292003: JUnit failure: managedbuilder testLinkedFolder intermittently fails
Benchmarks updated to 6.0.0 level
2009-11-20 04:46:14 +00:00
Andrew Gvozdev
e4c5888fca bug 212596: JUnit failures in cdt.managedbuilder.test.suite
updated outdated benchmark file
2009-11-20 03:41:24 +00:00
Andrew Gvozdev
f2b3b42052 bug 294135: JUnit failures related to files with spaces in managedbuilder test suite
Fixed regression bug and updated benchmarks.
2009-11-04 23:00:48 +00:00
Andrew Gvozdev
050f7ed2c8 bug 275462: Build failed due to dependency files with spaces
Benchmark reverted back until bug 294135 is figured out
2009-11-04 02:48:58 +00:00
Andrew Gvozdev
2321c8338a bug 212596: JUnit failures in cdt.managedbuilder.test.suite
Added missing empty lines to benchmarks to turn down noise on the console
2009-11-03 23:31:50 +00:00
Andrew Gvozdev
3d8d4261c6 bug 275462: Build failed due to dependency files with spaces
affected benchmark in a test case fixed
2009-11-03 22:17:35 +00:00
Andrew Gvozdev
e5e6d41831 bug 275462: Build failed due to dependency files with spaces
affected benchmark in a test case fixed
2009-11-03 22:08:47 +00:00
Andrew Gvozdev
0525ad390c bug 212596: JUnit failures in cdt.managedbuilder.test.suite
updated benchmarks to match CDT 6.0
2009-10-11 21:26:10 +00:00
Andrew Gvozdev
8ae8b431bc bug 212596: JUnit failures in cdt.managedbuilder.test.suite
added EOL after last line
2009-10-11 04:50:23 +00:00
Andrew Gvozdev
6700e5b1b3 bug 212596: JUnit failures in cdt.managedbuilder.test.suite
moved Benchmarks folders from archives outside to be able to enjoy CVS diff command
2009-10-08 21:18:16 +00:00
Andrew Gvozdev
8fa0d4662f bug 212596: JUnit failures in cdt.managedbuilder.test.suite
Test fails due to relying on absolute path
2009-08-01 01:41:24 +00:00
Andrew Gvozdev
390d64a00e bug 212596: JUnit failures in cdt.managedbuilder.test.suite
Setting benchmarks to pass with 6.0.0 release.
2009-08-01 01:15:43 +00:00
Andrew Gvozdev
f1f30777dd bug 212596: JUnit failures in cdt.managedbuilder.test.suite
Setting benchmarks to pass with 6.0.0 release.
2009-08-01 00:25:07 +00:00
Andrew Gvozdev
81e57ee9d9 bug 212596: JUnit failures in cdt.managedbuilder.test.suite
Setting benchmarks to pass with 6.0.0 release.
2009-07-31 23:59:02 +00:00
Mikhail Sennikovsky
31841a2ffe 1. Tool anouncement message fixes
2. Target tool calculation fixes
2. test fixes
2007-06-08 10:24:42 +00:00
Chris Recoskie
9a285184f9 fix for 129782 by Andrew Ferguson 2006-09-11 20:06:21 +00:00
Doug Schaefer
17464c08f4 Update Copyright dates and fix those that had no copyrights. 2006-06-23 17:27:03 +00:00
Leo Treggiari
8fb351caba Test makefile benchmark changes to match changes in makefile generation for double quotes and Echo. 2006-04-28 13:30:12 +00:00
Leo Treggiari
52bca0701f Test renamed from linkedLib 2006-04-27 00:36:48 +00:00
Leo Treggiari
61c6b0788f Add tests for new default dependency calculators 2006-02-27 17:57:02 +00:00
Leo Treggiari
70f115ea4d Update tests because of dependency calculation changes and Echo changes 2006-02-23 18:04:57 +00:00
Chris Recoskie
847a638e03 crecoski Nov 23, 2005
- MBS support for spaces in resource names
2005-11-23 19:19:08 +00:00
Leo Treggiari
fe343ab7d2 Fix case of Benchmark directory in zip file 2005-10-21 22:21:24 +00:00
Chris Recoskie
de026bcfe6 crecoskie Oct 14, 2005
- Adding macro support to buildDefinitions markup.  See Bugzilla 111203
2005-10-14 13:29:04 +00:00
Leo Treggiari
632b56175a Add test for InputType, assignToOption attribute 2005-09-27 23:35:14 +00:00
Leo Treggiari
3b1a507cc6 Additional external dependency calculator test 2005-09-07 13:37:38 +00:00
Leo Treggiari
d743e195a3 New test for external dependency management 2005-09-03 02:52:14 +00:00
Leo Treggiari
6edd7be0aa Update Test benchmarks because of content-type changes 2005-08-08 20:48:19 +00:00
Leo Treggiari
700bf57ccc Fix 100581 - add the .c extension to the project-specific C++ Source File type when converting an old CDT C++ project 2005-06-30 20:00:44 +00:00
Leo Treggiari
1f78ede7df Add resource custom build step test 2005-06-26 17:25:13 +00:00
Chris Recoskie
9f79372988 crecoskie June 13, 2005
- fix for Bugzilla 99483 (NPE in MBS if you have a file with no extension)
2005-06-14 02:08:29 +00:00
Leo Treggiari
50c552ee4d Apply Pre/Post Custom Build Step test from Bob Monteleone 2005-06-10 20:38:33 +00:00
Leo Treggiari
ea39904c50 Update some benchmark makefiles 2005-06-10 16:58:17 +00:00