| 1 |
# Makefile |
| 2 |
|
| 3 |
# Copyright (C) 2018-2020 Simon Spöhel |
| 4 |
# |
| 5 |
# This program is free software: you can redistribute it and/or modify |
| 6 |
# it under the terms of the GNU General Public License as published by |
| 7 |
# the Free Software Foundation, either version 3 of the License, or |
| 8 |
# (at your option) any later version. |
| 9 |
# |
| 10 |
# This program is distributed in the hope that it will be useful, |
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
# GNU General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU General Public License |
| 16 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
SHELL := sh -e |
| 19 |
|
| 20 |
SOFTWARE = sentineldl |
| 21 |
DOWNLOADDIR = /var/lib/$(SOFTWARE) |
| 22 |
|
| 23 |
SCRIPTS = data/*/orig/processing.sh data/*/orig/processing.d/* |
| 24 |
|
| 25 |
test: |
| 26 |
|
| 27 |
@echo -n "Checking for syntax errors" |
| 28 |
|
| 29 |
@for SCRIPT in $(SCRIPTS); \ |
| 30 |
do \ |
| 31 |
sh -n $${SCRIPT}; \ |
| 32 |
echo -n "."; \ |
| 33 |
done |
| 34 |
|
| 35 |
@echo " done." |
| 36 |
|
| 37 |
install: |
| 38 |
|
| 39 |
mkdir -p $(DESTDIR)/etc/$(SOFTWARE) |
| 40 |
cp -r settings/* $(DESTDIR)/etc/$(SOFTWARE) |
| 41 |
|
| 42 |
mkdir -p $(DESTDIR)/usr/lib/$(SOFTWARE) |
| 43 |
cp -r lib/sentinel $(DESTDIR)/usr/lib/$(SOFTWARE) |
| 44 |
cp lib/sentineldl $(DESTDIR)/usr/lib/$(SOFTWARE) |
| 45 |
|
| 46 |
mkdir -p $(DESTDIR)/usr/bin |
| 47 |
cp $(SOFTWARE) $(DESTDIR)/usr/bin |
| 48 |
|
| 49 |
mkdir -p $(DESTDIR)/$(DOWNLOADDIR) |
| 50 |
cp -r data/* $(DESTDIR)/$(DOWNLOADDIR) |
| 51 |
|
| 52 |
|
| 53 |
uninstall: |
| 54 |
|
| 55 |
for FILE in settings/*; \ |
| 56 |
do \ |
| 57 |
rm -f $(DESTDIR)/etc/$(SOFTWARE)/$$(basename $${FILE}); \ |
| 58 |
done |
| 59 |
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/etc/$(SOFTWARE) || true |
| 60 |
|
| 61 |
for FILE in lib/sentinel/*; \ |
| 62 |
do \ |
| 63 |
rm -f $(DESTDIR)/usr/lib/$(SOFTWARE)/sentinel/$$(basename $${FILE}); \ |
| 64 |
done |
| 65 |
rm -rf $(DESTDIR)/usr/lib/$(SOFTWARE)/sentinel |
| 66 |
rm -f $(DESTDIR)/usr/lib/$(SOFTWARE)/sentineldl |
| 67 |
rmdir $(DESTDIR)/usr/lib/$(SOFTWARE) |
| 68 |
|
| 69 |
rm -f $(DESTDIR)/usr/bin/$(SOFTWARE) |
| 70 |
|
| 71 |
rm -f $(DESTDIR)/$(DOWNLOADDIR)/S2MSI1C/orig/processing.sh |
| 72 |
for FILE in data/S2MSI1C/orig/processing.d/*; \ |
| 73 |
do \ |
| 74 |
rm -f $(DESTDIR)/$(DOWNLOADDIR)/S2MSI1C/orig/$$(basename $${FILE}); \ |
| 75 |
done |
| 76 |
|
| 77 |
rm -f $(DESTDIR)/$(DOWNLOADDIR)/S2MSI2A/orig/processing.sh |
| 78 |
for FILE in data/S2MSI2A/orig/processing.d/*; \ |
| 79 |
do \ |
| 80 |
rm -f $(DESTDIR)/$(DOWNLOADDIR)/S2MSI2A/orig/$$(basename $${FILE}); \ |
| 81 |
done |
| 82 |
|
| 83 |
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/$(DOWNLOADDIR)/S2MSI1C/orig || true |
| 84 |
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/$(DOWNLOADDIR)/S2MSI2A/orig || true |
| 85 |
|
| 86 |
distclean: |
| 87 |
|
| 88 |
reinstall: uninstall install |