|
1 | 1 | DESTDIR =
|
| 2 | + |
| 3 | +# Find library installation path |
| 4 | +INSTALL_PATH = $(patsubst Location:,,$(shell python3 -m pip show PSL | grep Location)) |
| 5 | +INSTALL_PATH_LEN = $(shell echo $(INSTALL_PATH) | wc -c) |
| 6 | + |
2 | 7 | all:
|
3 |
| - #make -C docs html |
4 |
| - #make -C docs/misc all |
5 |
| - # make in subdirectory PSLab-apps-master if it is there |
6 |
| - [ ! -d PSLab-apps-master ] || make -C PSLab-apps-master $@ DESTDIR=$(DESTDIR) |
7 |
| - python setup.py build |
8 | 8 | python3 setup.py build
|
9 | 9 |
|
10 |
| -clean: |
11 |
| - rm -rf docs/_* |
12 |
| - # make in subdirectory PSLab-apps-master if it is there |
13 |
| - [ ! -d PSLab-apps-master ] || make -C PSLab-apps-master $@ DESTDIR=$(DESTDIR) |
14 |
| - rm -rf PSL.egg-info build |
15 |
| - find . -name "*~" -o -name "*.pyc" -o -name "__pycache__" | xargs rm -rf |
| 10 | +fullcleanup: verifyFiles |
| 11 | + # Removes every PSL instance in system. Be careful and check if the following list got all files inside a python folder or related to PSLab |
| 12 | + find /usr/* -name "PSL*" -type d | xargs rm -rf |
| 13 | + find /usr/* -name "pslab*" -type d | xargs rm -rf |
| 14 | + find /opt/* -name "pslab-*" -type d | xargs rm -rf |
| 15 | + find /usr/* -name "Experiments" -type f | xargs rm -rf |
| 16 | + @echo "All selected files are deleted.." |
16 | 17 |
|
17 |
| -IMAGEDIR=$(DESTDIR)/usr/share/doc/pslab-common/images |
| 18 | +verifyFiles: |
| 19 | + @find /usr/* -name "PSL*" -type d |
| 20 | + @find /usr/* -name "pslab*" -type d |
| 21 | + @find /opt/* -name "pslab-*" -type d |
| 22 | + @find /usr/* -name "Experiments" -type f |
| 23 | + @echo -n "Confirm if you want to remove all these files.. [Y/N] " && read ans && [ $${ans:-N} = Y ] |
| 24 | + |
| 25 | +clean: |
| 26 | + # Remove build files |
| 27 | + @rm -rf docs/_* |
| 28 | + @rm -rf PSL.egg-info build |
| 29 | + @find . -name "*~" -o -name "*.pyc" -o -name "__pycache__" | xargs rm -rf |
| 30 | + if [ ${INSTALL_PATH_LEN} -gt 2 ]; then sudo rm -rf $(INSTALL_PATH)/PSL $(INSTALL_PATH)/PSL-1* ; fi |
18 | 31 |
|
19 | 32 | install:
|
20 |
| - # make in subdirectory PSLab-apps-master if it is there |
21 |
| - [ ! -d PSLab-apps-master ] || make -C PSLab-apps-master $@ DESTDIR=$(DESTDIR) |
22 |
| - # install documents |
23 |
| - install -d $(DESTDIR)/usr/share/doc/pslab |
24 |
| - #cp -a docs/_build/html $(DESTDIR)/usr/share/doc/pslab |
25 |
| - #cp docs/misc/build/*.html $(DESTDIR)/usr/share/doc/pslab/html |
26 |
| - # create ditributions for Python2 and Python3 |
27 |
| - python setup.py install --install-layout=deb \ |
28 |
| - --root=$(DESTDIR)/ --prefix=/usr |
29 |
| - python3 setup.py install --install-layout=deb \ |
30 |
| - --root=$(DESTDIR)/ --prefix=/usr |
31 |
| - # rules for udev |
| 33 | + python3 setup.py install |
32 | 34 | mkdir -p $(DESTDIR)/lib/udev/rules.d
|
33 | 35 | install -m 644 99-pslab.rules $(DESTDIR)/lib/udev/rules.d/99-pslab
|
34 |
| - # fix a few permissions |
35 |
| - #find $(DESTDIR)/usr/share/pslab/psl_res -name auto.sh -exec chmod -x {} \; |
0 commit comments