[Bio] / ReleaseTools / standard.mk Repository:
ViewVC logotype

View of /ReleaseTools/standard.mk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (annotate)
Fri Sep 10 12:54:37 2004 UTC (15 years, 5 months ago) by efrank
Branch: MAIN
So far, we've allowed each package to define all  kinds of rules in its
makefile.  That's wasteful and makesit hard to improve the system because,
when you want new build capabilities, you have to edit all those makefiles,
and users have to know too much.

Gather the business end of the build into standard.mk.  Have package makefiles
include standard.mk.  Modify Makefile.top to have -I so that package makefile
can find standard.mk.  problem solved.  Now package makefiles only need to
define a few macros to describe what to build.

#######################################################################
# standard.mk
#
# Centralized make rules, macros, etc., shared amongst the packages.
# Package level makefiles do  not define rules, targets, etc.  Instead,
# they define a few macros needed to generate the build lists and
# standard.mk does the rest.
#
# The general pattern is to have "all of a kind" selected by wildcard
# into a build product, e.g., all .c or .cc go into a library or
# all .py get .pyc'd into the install area.  But, there are a few
# macro's that define things to exclude, e.g., .c files that have main()
# and are executables or foo.py files that are top-level programs and
# are to be installed in bin as foo.
#
# A package level makefile does "include standard.mk".  This works because
# of -I's in the Makefile.top in the workdir.  See Makefile.PackageSample.
#
#######################################################################

##
# Document macros users define in their package level makefiles here:
##

#
#BINPYSCRIPTS := script1.py etc.  List of py scripts to install in bin.
#                Installed as script1, not script1.py.  Filtered out of
#                python library list (LIBPYFILES)
#
#BINSCRIPTS:     List of scripts to be copied to bin verbatim.
#
# (NB: haven't really coded rules to handle these two separately, correctly
# yet



##
# Various lists of things to build
##

LIBPYFILES := $(filter-out $(BINPYSCRIPTS), $(wildcard *.py))



##
# Targets
##

all: lib bin

bin:	$(foreach var, $(BINPYSCRIPTS), $(bindir)/$(var))

lib:	$(foreach var, $(LIBPYFILES), $(libdir)/$(PKGNAME)/$(var))

test:

clean:

##
# Rules
##

$(libdir)/$(PKGNAME)/%: $(TOPDIR)/$(PKGNAME)/%
	cp -p  $< $@

$(bindir)/%: $(TOPDIR)/$(PKGNAME)/%
	cp -p  $< `dirname $@`/`basename $@ .py`


##
# Dependency generation
#
# not written yet.  (of all the things not to have...)
#

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3