46 # PYMODDIR = bar
47 #
48 #
49 # It provides as output:
50 #
51 # ROOTPYFILES - The list of $(ROOT)-relative paths to which python
52 # source and binary files will be installed. Your
53 # Makefile's 'install' target should depend upon
54 # this.
55 #
56 # PYVERSOBJS - The list of paths to compiled python build products,
57 # including their subdirectory.
58 #
59 # pyclobber - A target on which 'clobber' should depend, which
60 # removes the per-version python directories and the
61 # output within them.
62 #
63
64 PYFILES = $(PYSRCS) $(PYOBJS)
65
66 ROOTPYDIR_24 = $(PYTOPDIR)/python2.4/$(PYMODDIR)
67 ROOTPYFILES_24 = $(PYFILES:%=$(ROOTPYDIR_24)/%)
68
69 ROOTPYDIR_26 = $(PYTOPDIR)/python2.6/$(PYMODDIR)
70 ROOTPYFILES_26 = $(PYFILES:%=$(ROOTPYDIR_26)/%)
71
72 ROOTPYFILES = $(ROOTPYFILES_24) $(ROOTPYFILES_26)
73 $(ROOTPYFILES) := FILEMODE = 0444
74
75 PYVERSDIRS = python2.4 python2.6
76
77 PY24OBJS = $(PYOBJS:%=python2.4/%)
78 $(PY24OBJS) := PYTHON = $(PYTHON_24)
79
80 PY26OBJS = $(PYOBJS:%=python2.6/%)
81 $(PY26OBJS) := PYTHON = $(PYTHON_26)
82
83 PYVERSOBJS = $(PY24OBJS) $(PY26OBJS)
84
85 CLOBBERFILES += $(PYVERSOBJS)
86 CLOBBERDIRS += $(PYVERSDIRS)
87
88 .KEEP_STATE:
89
90 python2.4/%.pyc python2.6/%.pyc: %.py
91 @[ -d $(@D) ] || mkdir $(@D)
92 $(RM) $@
93 $(PYTHON) -mpy_compile $<
94 $(MV) $(*).pyc $@
95
96 $(ROOTPYDIR_24)/%.pyc: python2.4/%.pyc
97 $(INS.pyfile)
98
99 $(ROOTPYDIR_26)/%.pyc: python2.6/%.pyc
100 $(INS.pyfile)
101
102 $(ROOTPYDIR_24)/%.py $(ROOTPYDIR_26)/%.py: %.py
103 $(INS.pyfile)
104
105 pyclobber:
106 $(RM) $(CLOBBERFILES)
107 $(RM) -rf $(CLOBBERDIRS)
|
46 # PYMODDIR = bar
47 #
48 #
49 # It provides as output:
50 #
51 # ROOTPYFILES - The list of $(ROOT)-relative paths to which python
52 # source and binary files will be installed. Your
53 # Makefile's 'install' target should depend upon
54 # this.
55 #
56 # PYVERSOBJS - The list of paths to compiled python build products,
57 # including their subdirectory.
58 #
59 # pyclobber - A target on which 'clobber' should depend, which
60 # removes the per-version python directories and the
61 # output within them.
62 #
63
64 PYFILES = $(PYSRCS) $(PYOBJS)
65
66 ROOTPYDIR_26 = $(PYTOPDIR)/python2.6/$(PYMODDIR)
67 ROOTPYFILES_26 = $(PYFILES:%=$(ROOTPYDIR_26)/%)
68
69 ROOTPYFILES = $(ROOTPYFILES_26)
70 $(ROOTPYFILES) := FILEMODE = 0444
71
72 PYVERSDIRS = python2.6
73
74 PY26OBJS = $(PYOBJS:%=python2.6/%)
75 $(PY26OBJS) := PYTHON = $(PYTHON_26)
76
77 PYVERSOBJS = $(PY26OBJS)
78
79 CLOBBERFILES += $(PYVERSOBJS)
80 CLOBBERDIRS += $(PYVERSDIRS)
81
82 .KEEP_STATE:
83
84 python2.6/%.pyc: %.py
85 @[ -d $(@D) ] || mkdir $(@D)
86 $(RM) $@
87 $(PYTHON) -mpy_compile $<
88 $(MV) $(*).pyc $@
89
90 $(ROOTPYDIR_26)/%.pyc: python2.6/%.pyc
91 $(INS.pyfile)
92
93 $(ROOTPYDIR_26)/%.py: %.py
94 $(INS.pyfile)
95
96 pyclobber:
97 $(RM) $(CLOBBERFILES)
98 $(RM) -rf $(CLOBBERDIRS)
|