Debian Codegraph @

Makefile

raw ◀ ▶
1 Debian patch touch this file
1 DESTDIR =
2 SUBDIRS = po clib/expeyes-clib
3 SUBDIRS_INDEP = expeyes-web \
4 microhope microhope/po microhope/microhope-doc \
•5 eyes17/lang eyes17 eyes17/layouts eyes17/helpFiles \
6 eyesjunior/lang eyesjunior/layouts eyesjunior/helpFiles \
7 bin
8
9 LANGS = ${wildcard eyes17/helpFiles| grep '^..$$'}
10 THIS_DIR = ${shell pwd}
11
12 all: all_arch all_indep all_firmware
13
14 all_arch:
15 python3 setup.py build
16 for d in $(SUBDIRS); do \
17 if [ -f $$d/configure.ac ]; then \
18 (cd $$d; autoreconf --install;) \
19 fi; \
20 if [ -x $$d/configure ]; then \
21 (cd $$d; ./configure --prefix=/usr; $(MAKE) all;) \
22 else \
23 $(MAKE) -C $$d all; \
24 fi; \
25 done
26
27 all_indep:
28 for d in $(SUBDIRS_INDEP); do \
29 $(MAKE) -C $$d all; \
30 done
31
32 all_firmware:
•33 for d in firmware kuttyPy/firmware microhope/firmware; do \
34 $(MAKE) -C $$d all; \
35 done
36
37 clean_firmware: clean
38 # clean the bootloader hex file
39 make -C microhope/firmware clean
40
41 install: install_arch install_indep
42
43 install_arch: all_arch
44 # for python3-expeyes
45 if grep -Eq "Debian|Ubuntu" /etc/issue; then \
46 python3 setup.py install --install-layout=deb \
47 --root=$(DESTDIR)/ --prefix=/usr; \
48 else \
49 python3 setup.py install --root=$(DESTDIR)/ --prefix=/usr; \
50 fi
51 install -d $(DESTDIR)/lib/udev/rules.d/
52 install -m 644 99-phoenix.rules $(DESTDIR)/lib/udev/rules.d/
•53 # for expeyes
54 install -d $(DESTDIR)/usr/share/expeyes
55 cp -a eyes $(DESTDIR)/usr/share/expeyes
56 # icons
57 install -d $(DESTDIR)/usr/share/icons
•58 install -m 644 pixmaps/expeyes-logo.png \
59 $(DESTDIR)/usr/share/icons/expeyes.png
60 install -m 644 pixmaps/expeyes-junior-icon.png \
61 $(DESTDIR)/usr/share/icons
62 install -m 644 pixmaps/eyes17-logo.png \
63 $(DESTDIR)/usr/share/icons
•64 install -m 644 pixmaps/expeyes-progman-jr-doc.png \
65 $(DESTDIR)/usr/share/icons
66 install -m 644 pixmaps/expeyes-progman-jr-doc.svg \
67 $(DESTDIR)/usr/share/icons
68 install -m 644 pixmaps/nuclear-icon.png \
69 $(DESTDIR)/usr/share/icons
70 install -m 644 pixmaps/eyes17-manuals.png \
71 $(DESTDIR)/usr/share/icons
72 # desktop files
73 install -d $(DESTDIR)/usr/share/applications
•74 install -m 644 desktop/expeyes.desktop \
75 desktop/expeyes-junior.desktop desktop/Phoenix-ASM.desktop \
76 desktop/expeyes-17.desktop \
77 $(DESTDIR)/usr/share/applications
•78 $(MAKE) -C po install DESTDIR=$(DESTDIR)
79 # for expeyes-doc-common
80 install -d $(DESTDIR)/usr/share/icons
81 # install -m 644 pixmaps/*doc.png $(DESTDIR)/usr/share/icons
82 install -d $(DESTDIR)/usr/share/applications
83 install -m 644 desktop/eyes17-doc.desktop $(DESTDIR)/usr/share/applications
84 # subdirs stuff
85 for d in $(SUBDIRS); do \
86 [ ! -f $$d/Makefile ] || $(MAKE) -C $$d install DESTDIR=$(DESTDIR); \
87 done
•88 # fix permissions in /usr/share/expeyes
89 find $(DESTDIR)/usr/share/expeyes -type f -exec chmod 644 {} \;
90 # for expeyes-clib
91 rm -f $(DESTDIR)/usr/share/expeyes/clib
92 ln -s /usr/lib/expeyes $(DESTDIR)/usr/share/expeyes/clib
93
94 install_indep: all_indep
95 for d in $(SUBDIRS_INDEP); do \
96 [ ! -f $$d/Makefile ] || $(MAKE) -C $$d install DESTDIR=$(DESTDIR); \
97 done
98 # fix a few permission
99 find $(DESTDIR) -name "*.pdf" -exec chmod -x {} \;
•100 # PO files for expeyes
101 make -C po install DESTDIR=$(DESTDIR)
102 # PO files for microhope
103 make -C microhope/po install DESTDIR=$(DESTDIR)
104 # files from eyesjunior
105 mkdir -p $(DESTDIR)/usr/share/eyesj
106 cp -a eyesjunior/* $(DESTDIR)/usr/share/eyesj
107 # files from eyes17
108 mkdir -p $(DESTDIR)/usr/share/eyes17
109 for f in eyes17/server*.html eyes17/*.py ; do \
110 cp $$f $(DESTDIR)/usr/share/eyes17; \
111 done
•112 #for d in code examples eyes17 html images lang layouts blockly screenshots; do
113 for d in code examples eyes17 html images lang layouts screenshots; do \
114 cp -a eyes17/$$d $(DESTDIR)/usr/share/eyes17; \
115 done
•116 # help files for eyes17's help popup
117 mkdir -p $(DESTDIR)/usr/share/eyes17/helpFiles
118 for d in pics schematics; do \
119 cp -a eyes17/helpFiles/$$d $(DESTDIR)/usr/share/eyes17/helpFiles; \
120 done
121 for l in $(LANGS); do \
122 mkdir -p $(DESTDIR)/usr/share/eyes17/helpFiles/$$l; \
123 cd $(THIS_DIR)/eyes17/helpFiles/$$l; \
124 cp -a *.html pics schematics \
125 $(DESTDIR)/usr/share/eyes17/helpFiles/$$l; \
126 done
127 # clean VCS files
128 find $(DESTDIR) -name .gitignore | xargs rm -f
129 # remove doctrees
130 find $(DESTDIR) -type d -name 'doctrees' | xargs rm -rf
131 # remove useless Makefiles
132 find $(DESTDIR) -name "Makefile*" | xargs rm -f
133 # remove aj-arrange-files.sh
134 rm -f $(DESTDIR)/usr/share/eyesj/helpFiles/aj-arrange-files.sh
135 # remove stale symlinks which break py3compile's work
136 for f in conf.py prettyLaTeX.py; do \
137 find $(DESTDIR)/usr/share/eyes17/helpFiles -name $$f | xargs rm -f; \
138 done
139
140 clean:
141 rm -rf *~ *.pyc build/ eyes/*~ eyes/*.pyc eyes-junior/*~ eyes-junior/*.pyc doc/fr/Docs/eyes.out
142 for d in $(SUBDIRS) $(SUBDIRS_INDEP); do \
•143 [ ! -f $$d/Makefile ] || $(MAKE) -C $$d distclean || $(MAKE) -C $$d clean; \
144 done
145 [ ! -d clib ] || (cd clib/expeyes-clib && sh clean-all.sh)
146 # fix compiles Python files created by the clean scripts above
147 find . -name __pycache__ | xargs rm -rf
148
149
150 .PHONY: all all_arch all_indep all_firmware install install_arch install_indep clean clean_firmware