Commit Graph

87 Commits

Author SHA1 Message Date
lukem 1defdf0961 bsd.dep.mk: fix "make tags" (again)
[repeat revision 1.85]

Fix "make tags" to actually build a tags file:
- Use !commands() instead of !target(), so that the rule actually works
- Write to ${.OBJDIR}/tags for read-only source (don't know why ${.TARGET}
  isn't sufficient).
- Only match *.[cly] from ${.ALLSRCS} - just excluding *.h causes failures
  because of ${targ}: subdir-${targ} in bsd.subdir.mk.

Thanks to uwe@ for assistance.
2020-07-01 07:38:29 +00:00
lukem c72411c4b5 bsd.dep.mk: revert 1.85 (for now)
Revert my recent 1.85 revision that fixed "make tags".  It causes too
much build breakage elsewhere in the tree that needs to be resolved first.

Issues include:
- Directories using TESTS_CXX with .cpp and .cxx extension instead of the
  default .cc extension (see bsd.prog.mk). Most of these have been fixed.
- external/gpl3/gcc build of .cc files. (No idea what's wrong there).
2020-06-22 01:04:26 +00:00
lukem 6445c9ec5a bsd.dep.mk: fix "make tags"
Fix "make tags" to actually build a tags file:
- Use !commands() instead of !target(), so that the rule actually works
- Write to ${.OBJDIR}/tags for read-only source (don't know why ${.TARGET}
  isn't sufficient).
- Only match *.[cly] from ${.ALLSRCS} - just excluding *.h causes failures
  because of ${targ}: subdir-${targ} in bsd.subdir.mk.

Thanks to uwe@ for assistance.
2020-06-21 03:39:21 +00:00
christos 0a4f449bbb Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.
2019-01-21 21:11:54 +00:00
christos 50b4b37dbe Don't remap mkdep, otherwise we add dependencies for /usr/include instead
of ${DESTDIR}/usr/include and things go south.
2016-12-21 03:00:51 +00:00
erh 6830ef879f PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.
2014-12-01 01:34:30 +00:00
plunky c76e451dca when calling mkdep, pass any -std=* flags for C and C++ source files
to ensure that any definitions this implies are set
2014-07-19 17:19:22 +00:00
matt 1b730ee018 add ${MKTARGET_CREATE} for tags 2013-12-05 22:49:33 +00:00
mrg 94542b393a create mkdep output with a temporary file so that failures in
complation during .d creation don't leave an empty (stale) .d
file around to break future builds.

(hmm, probably could use .PRECIOUS here.)
2013-10-31 01:55:03 +00:00
mrg 27d21cc6e9 add MKDEPCXX, that is used for C++ files depend creation. also
add some missing ${COPTS.${.IMPSRC:T}} and ${CPUFLAGS.${.IMPSRC:T}}
to the dependancy rules.

this makes it possible to have C++ files .d files created with the
C++ compiler, and with the normal options for this file, which
means that we can build libstdc++-v3 from gcc 4.8.
2013-10-28 01:47:13 +00:00
christos b5a766a4fb Add a rule to rebuild dependency files that contain stale entries automatically. 2013-03-05 21:59:01 +00:00
christos aa3d3ee6d3 MKDEPINCLUDES support. 2013-03-05 02:02:07 +00:00
apb 19862a7d7d Change some .if defined(SRCS) to .if defined(SRCS) && !empty(SRCS) 2012-11-18 19:48:29 +00:00
matt 47c982a38d Add support for --combine with gcc. 2012-02-19 23:19:37 +00:00
apb 386a389aab Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.
2011-09-10 16:57:35 +00:00
joerg c28ff146c9 For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.
2011-04-10 16:52:36 +00:00
joerg 5c52343643 Allow HOSTLIB to use C++ by not specifying -nostdinc++. 2011-02-06 00:52:49 +00:00
joerg d3a052c472 Allow use of traditional CPP to be set on a per platform base in sys.mk.
Honour this for dependency processing in bsd.dep.mk.  Switch i386 and
amd64 assembly to use ISO C90 preprocessor concat and drop the
-traditional-cpp on this platform.
2011-01-12 23:12:10 +00:00
christos 8dd41afecc PR/42658: Geoff Wing: Quote directory variables to deal with spaces in the
source pathname.
2010-01-25 00:43:00 +00:00
apb f46c1de7cb Use ${TOOL_SED} instead if plain sed in Makefiles. 2008-10-25 22:27:34 +00:00
lukem 6d15c512f3 remove AINC support; it is now unnecessary 2004-04-18 04:32:51 +00:00
lukem 84a4748659 Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.
2004-01-29 01:48:45 +00:00
lukem af85ccad70 Replace
:M-[IDU]*
with
	:C/-([IDU])[  ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)
2004-01-27 03:31:48 +00:00
dsl cd01ecc4cd Use -- to separate mkdep options from cc ones.
Avoids problems when the cc options start with -fpic.
2003-11-11 11:36:40 +00:00
dsl e6dd2bf0d9 Use modified mkdep(1) (not cat) to merge '*.d' into '.depend'.
Allows some of the postprocessing to be done there instead of a separate
sed script called from 'afterdepend'.
2003-11-10 18:21:55 +00:00
mrg 45e224e8d4 fix a typo in previous pointed out by lukem 2003-10-28 01:25:33 +00:00
mrg 8dcb3c2e33 allow -traditional-cpp to be overridden when making dependancies 2003-10-27 23:52:57 +00:00
lukem 130ab7336b Rework how MAKEVERBOSE operates:
*	Don't bother prefixing commands with a line of  ${_MKCMD}\
	and instead rely upon "make -s".  This is less intrusive on
	all the Makefiles than the former.  Idea from David Laight.

    *	Rename the variables use to print messages.  The scheme now is:
	    _MKMSG_FOO		Run  _MKMSG 'foo'
	    _MKTARGET_FOO	Run  _MKMSG_FOO ${.TARGET}
	From discussion with Alistair Crooks.
2003-10-21 10:01:19 +00:00
lukem 4ccb31e74a Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} "  ...  {$.TARGET}"  and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO
2003-10-19 03:00:55 +00:00
lukem 03b6213598 Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
    0	Minimal output ("quiet")
    1	Describe what is occurring
    2	Describe what is occurring and echo the actual command ("verbose")
	This is the default, and is equivalent to the previous behaviour.
2003-10-18 15:33:59 +00:00
lukem 28d70b03dc order .SUFFIXES similar to other *.mk files 2003-08-11 09:59:43 +00:00
martin 28ef1fc8fe Handle empty __DPSRCS.d, avoiding executing commands like "cat > .depend"
in directories where only non-C/C++ files are in SRCS (e.g.: the forth
code for sparc bootblocks).

Patch from Luke.
2003-08-06 13:55:11 +00:00
lukem a93ea220fc Rework how dependency generation is performed:
* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
  This is a change of behaviour.  If a Makefile wants the clean semantics
  it must specifically append to CLEANFILES.
  Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
  that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d  depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
2003-08-01 17:03:41 +00:00
lukem 3cbb5fea48 tweak ${DEPENDSRCS.d} target so that ${SRCS} isn't there. this fixes the
"make: out of memory" problem when make dependencies in lib/libc.

XXX: this is a temporary workaround.  i'm working on cleaning up how
the DPSRCS stuff is used throughout the tree...
2003-08-01 00:55:43 +00:00
lukem a504cd2911 bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.
2003-07-31 13:47:32 +00:00
lukem 86173c79de Set .NOPATH for all ${DEPENDSRCS} and not just .depend.
Should fix build problem noted by Geoff Wing on current-users@
2003-07-29 07:56:23 +00:00
lukem b082f4d46d Use the more "standard" `foo.d' instead of `foo.SUFFIX.dep'; the rules
are simpler and would have helped prevent the previous fubar.
Don't bother using -a with ${MKDEP} to build the individual .d files.
2003-07-28 23:57:24 +00:00
matt ebfb9912e2 Make all the suffix rules with .c .c.dep (e.g not .cc .cc.cc.dep) 2003-07-28 21:33:57 +00:00
lukem 8f4575345b Simplify .*.dep generation by using suffix transforms.
This also fixes a problem in the previous where the .ALLSRC would contain
any other dependencies that .depend had, thus breaking the mkdep invocation.

Provide DEPENDSRCS which effectively contains ".depend *.dep", to be
used in other Makefiles that want to add dependencies for .depend.
2003-07-28 15:07:16 +00:00
lukem 696a21d88f Always use the "per source file".dep method to build the .depend file
(that was formerly only used for HOST_CYGWIN.).
Clean up implementation to minimise unnecessary variable munging.
Ensure all .dep files are deleted in cleandepend:.

This allows us to correctly support CPPFLAGS.<file> in make depend, and
whilst this method is marginally slower in the "no existing .depend file"
case, it should be faster in the "rebuilding depend for a subset of
source files" case.
2003-07-28 08:59:52 +00:00
mrg 96d9a01177 introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes.  for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)
2003-07-27 14:49:22 +00:00
lukem 87610a53a9 whitespace cleanup 2003-07-18 04:04:03 +00:00
wiz a233f087fe Add missing } for rev. 1.43. 2003-06-11 18:05:40 +00:00
wiz cdf5450a15 Also recognize cpp files as C++ files for CYGWIN case. 2003-06-11 17:32:45 +00:00
christos d30f98df35 recognize .cpp as c++ files. 2003-06-11 17:24:55 +00:00
wiz 53588c2a8b Back this out until I know why it does not work. 2003-05-27 21:43:32 +00:00
wiz f338b31357 Add .cpp dependency rules. 2003-05-27 19:30:45 +00:00
christos b024767c0c Fix _HOST_CYGWIN lossage. 2003-05-08 20:39:00 +00:00
christos e9672445c0 Hacks for limited command and environment space (John Gordon) 2003-05-08 13:34:07 +00:00
thorpej f176c534d2 The traditional C preprocessor is fixed in GCC 3.3 now, so no need
to skip -traditional-cpp for HAVE_GCC3.
2002-11-26 18:42:30 +00:00