Retire Makefile.shared It has served its purpose, and been replaced by libtool. Change-Id: Ifb4e2f585fb4239e9138daef82dcc7f41d7f2a99 Reviewed-on: http://gerrit.openafs.org/11485 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: D Brashear <shadow@your-file-system.com>
Add "pretty" build option Add the capability to do a "pretty" build, where we output something like " CC /path/to/foo.o" to build foo.o, instead of the entire compiler invocation, similarly to how the Linux kernel build appears. Add the "pretty" building for CC and LD rules. This also prints out some helpful information when a command fails, which can sometimes otherwise be annoying to figure out post-mortem. To enable the pretty building, make with V=0. To output everything that is actually run with V=0, make with 'V=0 Q=' . Note that this does not work with all makes, since not all makes will propagate command-line-specified variables to sub-makes without -e. Non-working makes include /usr/ccs/bin/make on HP-UX and Solaris. However, GNU make will work, as will /usr/xpg4/bin/make on Solaris. Change-Id: Idce0afffe7d5be88b0743ec3f926a52efb1a6a74 Reviewed-on: http://gerrit.openafs.org/4486 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
Specify pattern rules in addition to suffix rules A few makefiles specify an old-style suffix rule, such as: .c.o: $(AFS_CCRULE) $< Not all makes seem to interpret these rules correctly (such as Solaris /usr/xpg4/bin/make). Since it is easy to do so, specify pattern-based rules along with these, like so: %.o: %.c $(AFS_CCRULE) $< Change-Id: I052f1156d1a7e29beedb0fb59390073c2521459e Reviewed-on: http://gerrit.openafs.org/5819 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
Add CCRULE variants for each build type Add explicit LWP, PTH and SHD variants of the CCRULE variable for LWP, pthreaded and shared-library builds respectively. This allows Makefiles which support building more than one target type to use these rules directly, rather than brewing their own. Modify all of the AFS_CCRULE definitions in the build type specific Makefiles to reference these rules, so we aren't specifying things twice. Change-Id: I79bb394cca8971ce71b10ef55b75d5169bf6b80c Reviewed-on: http://gerrit.openafs.org/3966 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Build: Fix broken bracketing in shared Makefile There was a stray ( in the shared library build system. We hadn't noticed this, as the only place that uses the shared makefile and produces binaries is the hcrypto test suite that isn't built by default. Change-Id: I1414c0e1db52307f8ffff4214f411bc028c03fd5 Reviewed-on: http://gerrit.openafs.org/3210 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
add objc build rules to make-type makefiles sadly this needs to be here unless we want os-specific includes of e.g. shared, lwp, pthreads makefiles for extra rules. as long as no .m files are built in generic makefiles, this is a reasonable approach. Change-Id: Ibea9f47131189f4b13760d0c50a0bc6b43815ce3 Reviewed-on: http://gerrit.openafs.org/2991 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Unix: Rework build system Rework the unix build system so that we support taking CFLAGS and LDFLAGS from the command line, and don't replace them with our own settings. Also, take the opportunity to bring some sanity and consistency into our Makefiles. The standard Makefile.config now defines rules for LWP, pthreaded and shared library builds. The CFLAGS settings for these are called LWP_CFLAGS, PTH_CFLAGS and SHD_CFLAGS, respectively. Similarly named variables are provided for LDFLAGS. A module may select to use a particular build type for its suffix rule by including either Makefile.lwp, Makefile.pthread or Makefile.shared from src/config. This creates an appropriate .c.o suffix rule, defines AFS_CFLAGS and AFS_LDFLAGS as appropriate, and creates two rules AFS_CCRULE and AFS_LDRULE, which can be used to build, and link objects. For example: foo.o: foo.c $(AFS_CCRULE) foo.c foo: foo.o $(AFS_LDRULE) foo.o If a you wish to override the CFLAGS or LDFLAGS for an object build using these rules (or through the .c.o suffix rule) you can do so, by defining CFLAGS_<object> or LDFLAGS_<object>. For example: CFLAGS_foo.o= -DDEBUG LDFLAGS_foo = -ldebugging A module may also alter the behaviour of the compile and link steps module wide by defining MODULE_CFLAGS or MODULE_LDFLAGS. This functionality is now used throughout the tree: *) Suffix rules are used wherever possible, removing a number of unecessary build rules. *) All link steps are replaced with AFS_LDRULE *) All standard compile steps are replaced with AFS_CCRULE *) Unusal compile steps are defined, as far as possible, int terms of the LWP_ PTH_ and SHD_ variables. *) The use of $? has been removed entirely, as it makes it impossible to provide build rules with dependency information Change-Id: If76207e45da402a0ed9d7c1bdbe83c58c911a4f2 Reviewed-on: http://gerrit.openafs.org/2896 Tested-by: BuildBot <buildbot@rampaginggeek.com> Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>