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

Annotation of /ReleaseTools/standard.mk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (view) (download)

1 : efrank 1.1 #######################################################################
2 :     # standard.mk
3 :     #
4 :     # Centralized make rules, macros, etc., shared amongst the packages.
5 :     # Package level makefiles do not define rules, targets, etc. Instead,
6 :     # they define a few macros needed to generate the build lists and
7 :     # standard.mk does the rest.
8 :     #
9 :     # The general pattern is to have "all of a kind" selected by wildcard
10 :     # into a build product, e.g., all .c or .cc go into a library or
11 :     # all .py get .pyc'd into the install area. But, there are a few
12 :     # macro's that define things to exclude, e.g., .c files that have main()
13 :     # and are executables or foo.py files that are top-level programs and
14 :     # are to be installed in bin as foo.
15 :     #
16 :     # A package level makefile does "include standard.mk". This works because
17 :     # of -I's in the Makefile.top in the workdir. See Makefile.PackageSample.
18 :     #
19 :     #######################################################################
20 :    
21 : efrank 1.2 ########################################################################
22 : efrank 1.1 # Document macros users define in their package level makefiles here:
23 : efrank 1.2 ########################################################################
24 : efrank 1.1 #
25 :     #BINPYSCRIPTS := script1.py etc. List of py scripts to install in bin.
26 :     # Installed as script1, not script1.py. Filtered out of
27 :     # python library list (LIBPYFILES)
28 :     #
29 :     #BINSCRIPTS: List of scripts to be copied to bin verbatim.
30 :     #
31 : efrank 1.2 #
32 :     #SCHEMATOOLS := file.st, etc. List of python files defining input to schema
33 :     # tools.
34 : efrank 1.1
35 :    
36 :    
37 : efrank 1.2 ########################################################################
38 : efrank 1.1 # Various lists of things to build
39 : efrank 1.2 # implemented via macros above.
40 :     ########################################################################
41 :    
42 : efrank 1.1
43 :     LIBPYFILES := $(filter-out $(BINPYSCRIPTS), $(wildcard *.py))
44 :    
45 :    
46 :    
47 : efrank 1.2 ########################################################################
48 :     # Package-level makefile Targets
49 :     ########################################################################
50 :    
51 : efrank 1.3 # this follows the all: in Makefile.top, but we drop decouple:, makefile:,
52 :     # and installdirs:, because those don't make sense at package level
53 : efrank 1.1
54 : efrank 1.3 all: schematools lib bin
55 : efrank 1.1
56 : efrank 1.2 bin: $(foreach var, $(BINPYSCRIPTS), $(subst .py,,$(bindir)/$(var))) $(foreach var, $(BINSCRIPTS), $(bindir)/$(var))
57 : efrank 1.1
58 :     lib: $(foreach var, $(LIBPYFILES), $(libdir)/$(PKGNAME)/$(var))
59 :    
60 : efrank 1.3 schematools: $(foreach var, $(subst .st,,$(SCHEMATOOLS)), $(libdir)/$(PKGNAME)Gen/$(var).py) $(foreach var, $(subst .st,,$(SCHEMATOOLS)), $(libdir)/$(PKGNAME)Gen/$(var).sql) $(foreach var, $(subst .st,,$(SCHEMATOOLS)), $(libdir)/$(PKGNAME)Gen/$(var)DbiHandler.py)
61 : efrank 1.2
62 : efrank 1.1 test:
63 :    
64 :     clean:
65 :    
66 : efrank 1.2 ########################################################################
67 :     # Rules
68 :     ########################################################################
69 :    
70 : efrank 1.1 ##
71 : efrank 1.2 # lib related
72 : efrank 1.1 ##
73 : efrank 1.2 # verbatim copy from sourcedir to libdir, e.g., py (distutils someday...)
74 :     $(libdir)/$(PKGNAME)/%: $(TOPDIR)/$(PKGNAME)/%
75 :     cp -p $< $@
76 : efrank 1.1
77 : efrank 1.2 # generate .py from schematools description of class. (Kah related)
78 : efrank 1.3 $(libdir)/$(PKGNAME)Gen/%.py: $(TOPDIR)/$(PKGNAME)/%.st
79 : efrank 1.2 cd $(libdir)/$(PKGNAME); generatePy $< > $@
80 :    
81 :     # generate .sql from schematools description of class. (Kah related)
82 : efrank 1.3 $(libdir)/$(PKGNAME)Gen/%.sql: $(TOPDIR)/$(PKGNAME)/%.st
83 : efrank 1.2 cd $(libdir)/$(PKGNAME); generateDb $< > $@
84 :    
85 :     # generate object/relational converters from schematools
86 :     # description of class. (Kah related)
87 : efrank 1.3 $(libdir)/$(PKGNAME)Gen/%DbiHandler.py: $(TOPDIR)/$(PKGNAME)/%.st
88 : efrank 1.2 cd $(libdir)/$(PKGNAME); generateDbiHandler $< > $@
89 :    
90 :     ##
91 :     # bin related
92 :     ##
93 :     # python scripts. make script, "foo" from "foo.py". (rewrite path #! someday)
94 :     $(bindir)/%: $(TOPDIR)/$(PKGNAME)/%.py
95 : efrank 1.1 cp -p $< $@
96 : efrank 1.4 chmod 755 $@
97 : efrank 1.1
98 : efrank 1.2 # scripts to copy verbatim.
99 : efrank 1.1 $(bindir)/%: $(TOPDIR)/$(PKGNAME)/%
100 : efrank 1.2 cp -p $< $@
101 : efrank 1.4 chmod 755 $@
102 : efrank 1.1
103 :    
104 : efrank 1.2 ########################################################################
105 : efrank 1.1 # Dependency generation
106 : efrank 1.2 ########################################################################
107 : efrank 1.1 #
108 :     # not written yet. (of all the things not to have...)
109 :     #

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3