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

Annotation of /ReleaseTools/standard.mk

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (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 : efrank 1.6 #BINSHSCRIPTS: List of borne shell scripts to be copied to bin verbatim.
29 :     #
30 :     #SCHEMATOOLS := file.py, etc. List of python files defining input to schema
31 :     # tools.
32 : efrank 1.1 #
33 :     #BINSCRIPTS: List of scripts to be copied to bin verbatim.
34 :     #
35 : efrank 1.6 # *** migrate away from BINSCRIPTS! The extra info that
36 :     # *** its borne shell, py, etc., will let us edit the #! line
37 :     # *** during installation, eventually.
38 : efrank 1.2 #
39 : efrank 1.1
40 :    
41 :    
42 : efrank 1.2 ########################################################################
43 : efrank 1.1 # Various lists of things to build
44 : efrank 1.2 # implemented via macros above.
45 :     ########################################################################
46 :    
47 : efrank 1.1
48 : efrank 1.5 LIBPYFILES := $(filter-out $(BINPYSCRIPTS) $(SCHEMATOOLS), $(wildcard *.py))
49 : efrank 1.1
50 :    
51 :    
52 : efrank 1.2 ########################################################################
53 :     # Package-level makefile Targets
54 :     ########################################################################
55 :    
56 : efrank 1.3 # this follows the all: in Makefile.top, but we drop decouple:, makefile:,
57 :     # and installdirs:, because those don't make sense at package level
58 : efrank 1.1
59 : efrank 1.3 all: schematools lib bin
60 : efrank 1.1
61 : efrank 1.6 bin: $(foreach var, $(BINPYSCRIPTS), $(subst .py,,$(bindir)/$(var))) $(foreach var, $(BINSHSCRIPTS), $(subst .sh,,$(bindir)/$(var))) $(foreach var, $(BINSCRIPTS), $(bindir)/$(var))
62 : efrank 1.1
63 :     lib: $(foreach var, $(LIBPYFILES), $(libdir)/$(PKGNAME)/$(var))
64 :    
65 : efrank 1.5 schematools: stDeclFiles stGeneratedFiles
66 :    
67 :     stDeclFiles: $(foreach var, $(SCHEMATOOLS), $(libdir)/$(PKGNAME)/$(var))
68 :    
69 :     stGeneratedFiles: $(foreach var, $(subst .py,,$(SCHEMATOOLS)), $(libdir)/$(PKGNAME)Gen/$(var)_st.py) $(foreach var, $(subst .py,,$(SCHEMATOOLS)), $(libdir)/$(PKGNAME)Gen/$(var).sql) $(foreach var, $(subst .py,,$(SCHEMATOOLS)), $(libdir)/$(PKGNAME)Gen/$(var)DbiHandler.py)
70 : efrank 1.2
71 : efrank 1.1 test:
72 :    
73 :     clean:
74 :    
75 : efrank 1.2 ########################################################################
76 :     # Rules
77 :     ########################################################################
78 :    
79 : efrank 1.1 ##
80 : efrank 1.2 # lib related
81 : efrank 1.1 ##
82 : efrank 1.5 $(libdir)/$(PKGNAME)/%.py: $(TOPDIR)/$(PKGNAME)/%.py $(libdir)/$(PKGNAME)/__init__.py
83 :     cp -p $< $@
84 :    
85 :     $(libdir)/$(PKGNAME)/__init__.py: $(TOPDIR)/$(PKGNAME)/__init__.py
86 :     cp -p $< $@
87 :    
88 : efrank 1.2 # verbatim copy from sourcedir to libdir, e.g., py (distutils someday...)
89 : efrank 1.5 # keep this overly generic one below the more specific py, above.
90 : efrank 1.2 $(libdir)/$(PKGNAME)/%: $(TOPDIR)/$(PKGNAME)/%
91 :     cp -p $< $@
92 : efrank 1.1
93 : efrank 1.2 # generate .py from schematools description of class. (Kah related)
94 : efrank 1.5 $(libdir)/$(PKGNAME)Gen/%_st.py: $(TOPDIR)/$(PKGNAME)/%.py
95 : efrank 1.2 cd $(libdir)/$(PKGNAME); generatePy $< > $@
96 :    
97 :     # generate .sql from schematools description of class. (Kah related)
98 : efrank 1.5 $(libdir)/$(PKGNAME)Gen/%.sql: $(TOPDIR)/$(PKGNAME)/%.py
99 : efrank 1.2 cd $(libdir)/$(PKGNAME); generateDb $< > $@
100 :    
101 :     # generate object/relational converters from schematools
102 :     # description of class. (Kah related)
103 : efrank 1.5 $(libdir)/$(PKGNAME)Gen/%DbiHandler.py: $(TOPDIR)/$(PKGNAME)/%.py
104 : efrank 1.2 cd $(libdir)/$(PKGNAME); generateDbiHandler $< > $@
105 :    
106 :     ##
107 :     # bin related
108 :     ##
109 :     # python scripts. make script, "foo" from "foo.py". (rewrite path #! someday)
110 :     $(bindir)/%: $(TOPDIR)/$(PKGNAME)/%.py
111 : efrank 1.1 cp -p $< $@
112 : efrank 1.4 chmod 755 $@
113 : efrank 1.1
114 : efrank 1.6 # borne shell scripts
115 :    
116 :     $(bindir)/%: $(TOPDIR)/$(PKGNAME)/%.sh
117 :     cp -p $< $@
118 :     chmod 755 $@
119 :    
120 : efrank 1.2 # scripts to copy verbatim.
121 : efrank 1.1 $(bindir)/%: $(TOPDIR)/$(PKGNAME)/%
122 : efrank 1.2 cp -p $< $@
123 : efrank 1.4 chmod 755 $@
124 : efrank 1.1
125 :    
126 : efrank 1.2 ########################################################################
127 : efrank 1.1 # Dependency generation
128 : efrank 1.2 ########################################################################
129 : efrank 1.1 #
130 :     # not written yet. (of all the things not to have...)
131 :     #

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3