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

Diff of /ReleaseTools/standard.mk

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Fri Sep 10 12:54:37 2004 UTC revision 1.9, Fri Mar 11 22:26:14 2005 UTC
# Line 18  Line 18 
18  #  #
19  #######################################################################  #######################################################################
20    
21  ##  ########################################################################
22  # Document macros users define in their package level makefiles here:  # Document macros users define in their package level makefiles here:
23  ##  ########################################################################
   
24  #  #
25  #BINPYSCRIPTS := script1.py etc.  List of py scripts to install in bin.  #BINPYSCRIPTS := script1.py etc.  List of py scripts to install in bin.
26  #                Installed as script1, not script1.py.  Filtered out of  #                Installed as script1, not script1.py.  Filtered out of
27  #                python library list (LIBPYFILES)  #                python library list (LIBPYFILES)
28    #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  #  #
33  #BINSCRIPTS:     List of scripts to be copied to bin verbatim.  #BINSCRIPTS:     List of scripts to be copied to bin verbatim.
34  #  #
35  # (NB: haven't really coded rules to handle these two separately, correctly  #                *** migrate away from BINSCRIPTS!  The extra info that
36  # yet  #                *** its borne shell, py, etc., will let us edit the #! line
37    #                *** during installation, eventually.
38    #
39    
40    
41    
42  ##  ########################################################################
43  # Various lists of things to build  # Various lists of things to build
44  ##  #   implemented via macros above.
45    ########################################################################
46    
 LIBPYFILES := $(filter-out $(BINPYSCRIPTS), $(wildcard *.py))  
47    
48    LIBPYFILES := $(filter-out $(BINPYSCRIPTS) $(SCHEMATOOLS), $(wildcard *.py))
49    
50    
 ##  
 # Targets  
 ##  
51    
52  all: lib bin  ########################################################################
53    # Package-level makefile Targets
54    ########################################################################
55    
56  bin:    $(foreach var, $(BINPYSCRIPTS), $(bindir)/$(var))  # 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    
59    all: schematools lib bin
60    
61    bin:    $(foreach var, $(BINPYSCRIPTS), $(subst .py,,$(bindir)/$(var))) $(foreach var, $(BINSHSCRIPTS), $(subst .sh,,$(bindir)/$(var))) $(foreach var, $(BINSCRIPTS), $(bindir)/$(var))
62    
63  lib:    $(foreach var, $(LIBPYFILES), $(libdir)/$(PKGNAME)/$(var))  lib:    $(foreach var, $(LIBPYFILES), $(libdir)/$(PKGNAME)/$(var))
64    
65    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    
71  test:  test:
72    
73  clean:  clean:
74    
75  ##  ########################################################################
76  # Rules  # Rules
77    ########################################################################
78    
79  ##  ##
80    # lib related
81    ##
82    
83    
84    $(libdir)/$(PKGNAME)/%.py: $(TOPDIR)/$(PKGNAME)/%.py
85            cp -p  $< $@
86    
87    $(libdir)/$(PKGNAME)/__init__.py: $(TOPDIR)/$(PKGNAME)/__init__.py
88            cp -p  $< $@
89    
90    # verbatim copy from sourcedir to libdir, e.g., py (distutils someday...)
91    # keep this overly generic one below the more specific py, above.
92  $(libdir)/$(PKGNAME)/%: $(TOPDIR)/$(PKGNAME)/%  $(libdir)/$(PKGNAME)/%: $(TOPDIR)/$(PKGNAME)/%
93          cp -p  $< $@          cp -p  $< $@
94    
95  $(bindir)/%: $(TOPDIR)/$(PKGNAME)/%  # generate .py from schematools description of class. (Kah related)
         cp -p  $< `dirname $@`/`basename $@ .py`  
96    
97    #    Note- add a __init__ dep because everything is required to be a package
98    # and so must have an __init__.  putting the dep here is a way to force the
99    # __init__ to be copied into the dir first so that i can immediately
100    # be ref'd as a package.  this is needed for schema tools ina way i don't
101    # grok yet
102    
103    $(libdir)/$(PKGNAME)Gen/%_st.py: $(TOPDIR)/$(PKGNAME)/%.py  $(libdir)/$(PKGNAME)/__init__.py
104            cd $(libdir)/$(PKGNAME); $(bindir)/generatePy $< > $@
105    
106    # generate .sql from schematools description of class. (Kah related)
107    $(libdir)/$(PKGNAME)Gen/%.sql: $(TOPDIR)/$(PKGNAME)/%.py
108            cd $(libdir)/$(PKGNAME); $(bindir)/generateDb $< > $@
109    
110    # generate object/relational converters from schematools
111    # description of class. (Kah related)
112    $(libdir)/$(PKGNAME)Gen/%DbiHandler.py: $(TOPDIR)/$(PKGNAME)/%.py
113            cd $(libdir)/$(PKGNAME); $(bindir)/generateDbiHandler $< > $@
114    
115    ##
116    # bin related
117  ##  ##
118    # python scripts. make script, "foo" from "foo.py".  (rewrite path #! someday)
119    $(bindir)/%: $(TOPDIR)/$(PKGNAME)/%.py
120            cp -p  $< $@
121            chmod 755 $@
122    
123    # borne shell scripts
124    
125    $(bindir)/%: $(TOPDIR)/$(PKGNAME)/%.sh
126            cp -p  $< $@
127            chmod 755 $@
128    
129    # scripts to copy verbatim.
130    $(bindir)/%: $(TOPDIR)/$(PKGNAME)/%
131            cp -p  $< $@
132            chmod 755 $@
133    
134    
135    ########################################################################
136  # Dependency generation  # Dependency generation
137    ########################################################################
138  #  #
139  # not written yet.  (of all the things not to have...)  # not written yet.  (of all the things not to have...)
140  #  #

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.9

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3