diff --git a/.github/workflows/ci_compile.yml b/.github/workflows/ci_compile.yml index 7df0ed71b..e870500ee 100644 --- a/.github/workflows/ci_compile.yml +++ b/.github/workflows/ci_compile.yml @@ -21,11 +21,8 @@ jobs: - uses: actions/checkout@v2 # Runs a set of commands using the runners shell - - name: make deps + - name: make deps all run: | - sudo make deps - - # Info: depends an step "make deps" - - name: make all - run: | - sudo make all + sudo apt update + sudo make -C src deps + make -C src all diff --git a/Makefile b/Makefile index 929a38292..4fd59098d 100644 --- a/Makefile +++ b/Makefile @@ -1,59 +1,26 @@ platform = $(shell uname -m) -prefix = - -sysconfdir = ${prefix}/etc -exec_prefix = /usr -bindir = ${exec_prefix}/bin -libexecdir = ${exec_prefix}/libexec/allsky -sharedir = ${exec_prefix}/share/allsky .DEFAULT_GOAL := all ROOTCHECK=$(shell id -u) -ifneq ($(ROOTCHECK),0) - ifeq ($(PKGBUILD),1) - ROOTCHECK=0 - endif -endif - -ifeq ($(PKGBUILD),) - PKGBUILD=0 -endif %: - @make -C src $@ - @make -C config_repo $@ - @make -C notificationImages $@ - @make -C scripts $@ + @echo "Nothing to do for 'all'. Run 'sudo make install' instead." -deps: - @make -C src $@ - -.PHONY : deps -install: ifneq ($(ROOTCHECK), 0) - @echo This must be run with root permissions. - @echo Please run \'sudo make install\' +install: + @echo "This must be run with root permissions." + @echo "Please run 'sudo make install'." else +install: @echo `date +%F\ %R:%S` Starting install... + @echo "" @make -C src $@ + @echo "" @make -C config_repo $@ - @make -C notificationImages $@ - @make -C scripts $@ - @if [ $(PKGBUILD) -eq 1 ]; then \ - [ ! -e $(DESTDIR)$(libexecdir) ] && mkdir -p $(DESTDIR)$(libexecdir) \ - install allsky.sh $(DESTDIR)$(libexecdir)/allsky.sh; \ - fi - @if [ $(PKGBUILD) -ne 1 ]; then \ - echo `date +%F\ %R:%S` Setting directory permissions...; \ - [ ! -e tmp ] && mkdir tmp; \ - chown -R $(SUDO_USER):$(SUDO_USER) ./ ; \ - echo ""; \ - echo ""; \ - echo `date +%F\ %R:%S` Install complete; \ - echo ""; \ - echo ""; \ - fi + @echo "" + @echo "\n\n`date +%F\ %R:%S` Install complete\n\n" endif + .PHONY : install diff --git a/config_repo/Makefile b/config_repo/Makefile index b483d90ae..4b16d8746 100644 --- a/config_repo/Makefile +++ b/config_repo/Makefile @@ -1,135 +1,83 @@ platform = $(shell uname -m) -prefix = - -sysconfdir = ${prefix}/etc -exec_prefix = /usr -bindir = ${exec_prefix}/bin -libexecdir = ${exec_prefix}/libexec/allsky -sharedir = ${exec_prefix}/share/allsky HOMEDIR = $(shell dirname "$$PWD") +CONFIGDIR = ${HOMEDIR}/config SCRIPTSDIR = ${HOMEDIR}/scripts UTILITIESDIR = ${SCRIPTSDIR}/utilities # TODO: get from variables.sh NORESTARTCODES = 100 101 +LIBSYSTEMDIR = /lib/systemd/system .DEFAULT_GOAL := all ROOTCHECK=$(shell id -u) -ifneq ($(ROOTCHECK),0) - ifeq ($(PKGBUILD),1) - ROOTCHECK=0 - endif -endif - -ifeq ($(PKGBUILD),) - PKGBUILD=0 -endif - ENVFILE := env.json -UNINSTALLFILES := $(DESTDIR)$(sysconfdir)/logrotate.d/allsky $(DESTDIR)$(sysconfdir)/rsyslog.d/allsky.conf $(DESTDIR)$(sysconfdir)/systemd/system/allsky.service $(DESTDIR)$(sysconfdir)/systemd/system/allskyperiodic.service +UNINSTALLFILES := /etc/logrotate.d/allsky /etc/rsyslog.d/allsky.conf /etc/systemd/system/allsky.service /etc/systemd/system/allskyperiodic.service %: - @echo `date +%F\ %R:%S` nothing to do for $@ + @echo "`date +%F\ %R:%S` nothing to do for $@" ifneq ($(ROOTCHECK), 0) install uninstall: @echo "This must be run with root permissions." - @echo "Please run 'sudo make $@'" + @echo "Please run 'sudo make $@'." else # Root check passed uninstall: - @echo `date +%F\ %R:%S` Removing installed files: $(UNINSTALLFILES) + @echo "`date +%F\ %R:%S` Removing installed files: $(UNINSTALLFILES)" @rm -f $(UNINSTALLFILES) - @echo `date +%F\ %R:%S` Complete. - @echo `date +%F\ %R:%S` NOTE: Config files were \-NOT\- removed. - @echo `date +%F\ %R:%S` To remove config files, please run \'sudo make remove_configs\' + @echo "`date +%F\ %R:%S` Complete." + @echo "`date +%F\ %R:%S` NOTE: Config files were -NOT- removed." + @echo "`date +%F\ %R:%S` To remove config files, please run 'sudo make remove_configs'." .PHONY : uninstall -ifeq ($(PKGBUILD),1) # In package build mode ###################################### Needs testing - -remove_configs: - @echo `date +%F\ %R:%S` Removing config path and files $(DESTDIR)$(sysconfigdir)/allsky - @rm -rf $(DESTDIR)$(sysconfigdir)/allsky - -createDirs: - @echo `date +%F\ %R:%S` Creating directory structures... - @if [ ! -e $(DESTDIR)$(sysconfdir)/allsky ]; then mkdir -p $(DESTDIR)$(sysconfdir)/allsky; fi - @if [ ! -e $(DESTDIR)$(sysconfdir)/profile.d ]; then mkdir -p $(DESTDIR)$(sysconfdir)/profile.d; fi - @if [ ! -e $(DESTDIR)$(sysconfdir)/systemd/system ]; then mkdir -p $(DESTDIR)$(sysconfdir)/systemd/system; fi - @if [ ! -e $(DESTDIR)$(sysconfdir)/udev/rules.d ]; then mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d; fi -.PHONY : createDirs - -$(ENVFILE): - @if [ ! -e $(DESTDIR)$(sysconfdir)/allsky/$@ ]; then \ - echo `date +%F\ %R:%S` Copying default $@; \ - cp $@.repo > env; \ - install -m 0664 env $(HOMEDIR)/$@; \ - rm -f env; \ - fi -# TODO: In PKGBUILD mode, where is the "allsky" directory? $(ENVFILE) needs to go in it. -# Is $(HOMEDIR) the correct location, or should it be $(DESTDIR)$(sysconfdir)/allsky ? -.PHONY : $(ENVFILE) - -install: createDirs $(ENVFILE) - @echo `date +%F\ %R:%S` Setting up udev rules... - @install -D -m 0644 asi.rules $(DESTDIR)$(sysconfdir)/udev/rules.d/ - @echo `date +%F\ %R:%S` Setting up logging... - @install -D -m 0644 allsky.logrotate.repo $(DESTDIR)$(sysconfdir)/logrotate.d/allsky - @install -D -m 0644 allsky.rsyslog.repo $(DESTDIR)$(sysconfdir)/rsyslog.d/allsky.conf - @echo `date +%F\ %R:%S` Setting allsky to auto start... - @sed -e "s|XX_ALLSKY_OWNER_XX|allsky|" -e "s|XX_ALLSKY_HOME_XX|$(bindir)|" allsky.service.repo > allsky.service - @install -m 0644 allsky.service $(DESTDIR)$(sysconfdir)/systemd/system/ - @rm -f allsky.service - @echo `date +%F\ %R:%S` Setting up home environment variable... - @echo "export ALLSKY_TMP=/tmp\nexport ALLSKY_CONFIG=$(DESTDIR)$(sysconfdir)/allsky\nexport ALLSKY_SCRIPTS=$(DESTDIR)$(libexecdir)\nexport ALLSKY_NOTIFICATION_IMAGES=$(DESTDIR)$(sharedir)\nexport ALLSKY_IMAGES=/home/allsky/images/\nPATH=${PATH}:${DESTDIR}$(libexedir)" > $(DESTDIR)$(sysconfdir)/profile.d/allsy.sh - - -else # Not in package build mode ###################################### - remove_configs: - @echo `date +%F\ %R:%S` Removing config path and files ../config - @rm -rf ../config + @echo "`date +%F\ %R:%S` Removing config path and files $(CONFIGDIR)" + @rm -rf $(CONFIGDIR) .PHONY : remove_configs createDirs: - @echo `date +%F\ %R:%S` Creating directory structures... - @if [ ! -e ../config ]; then mkdir -p ../config; chown $(SUDO_USER):$(SUDO_USER) ../config; fi + @echo "`date +%F\ %R:%S` Creating directory structures..." + @if [ ! -e $(CONFIGDIR) ]; then \ + mkdir -p $(CONFIGDIR); \ + chown $(SUDO_USER):$(SUDO_USER) $(CONFIGDIR); \ + fi .PHONY : createDirs install: createDirs - @echo `date +%F\ %R:%S` Setting up udev rules... - @install -D -m 0644 asi.rules $(DESTDIR)$(sysconfdir)/udev/rules.d/ - @echo `date +%F\ %R:%S` Setting up logging... - @install -D -m 0644 allsky.logrotate.repo $(DESTDIR)$(sysconfdir)/logrotate.d/allsky - @install -D -m 0644 allsky.rsyslog.repo $(DESTDIR)$(sysconfdir)/rsyslog.d/allsky.conf + @echo "`date +%F\ %R:%S` Setting up udev rules..." + @install -D -m 0644 asi.rules /etc/udev/rules.d/ + @echo "`date +%F\ %R:%S` Setting up logging..." + @install -D -m 0644 allsky.logrotate.repo /etc/logrotate.d/allsky + @install -D -m 0644 allsky.rsyslog.repo /etc/rsyslog.d/allsky.conf @udevadm control -R @udevadm trigger - @echo `date +%F\ %R:%S` Setting allsky to auto start... + @echo "`date +%F\ %R:%S` Setting allsky to auto start..." @if [ -e /etc/xdg/lxsession/LXDE-pi/autostart ]; then \ sed -i '/allsky.sh/d' /etc/xdg/lxsession/LXDE-pi/autostart; fi - @# Don't use the /lib/systemd/system directory - sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" \ + @# Don't use the $(LIBSYSTEMDIR) directory + @sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" \ -e "s|XX_ALLSKY_HOME_XX|$(HOMEDIR)|" \ -e "s|XX_NO_RESTART_CODES_XX|$(NORESTARTCODES)|" \ -e "s|XX_ALLSKY_UTILITIES_XX|$(UTILITIESDIR)|" \ allsky.service.repo > allsky.service - @install -m 0644 allsky.service $(DESTDIR)$(sysconfdir)/systemd/system/ + @install -m 0644 allsky.service /etc/systemd/system/ @rm -f allsky.service - @if [ -e /lib/systemd/system/allsky.service ]; then rm -f /lib/systemd/system/allsky.service; fi - sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" \ + @if [ -e $(LIBSYSTEMDIR)/allsky.service ]; then rm -f $(LIBSYSTEMDIR)/allsky.service; fi + @sed -e "s|XX_ALLSKY_OWNER_XX|$(SUDO_USER)|" \ -e "s|XX_NO_RESTART_CODES_XX|$(NORESTARTCODES)|" \ -e "s|XX_ALLSKY_SCRIPTS_XX|$(SCRIPTSDIR)|" \ allskyperiodic.service.repo > allskyperiodic.service - @install -m 0644 allskyperiodic.service $(DESTDIR)$(sysconfdir)/systemd/system/ + @install -m 0644 allskyperiodic.service /etc/systemd/system/ @rm -f allskyperiodic.service - @if [ -e /lib/systemd/system/allskyperiodic.service ]; then rm -f /lib/systemd/system/allskyperiodic.service; fi + @if [ -e $(LIBSYSTEMDIR)/allskyperiodic.service ]; then rm -f $(LIBSYSTEMDIR)/allskyperiodic.service; fi @systemctl daemon-reload @systemctl enable allsky @systemctl enable allskyperiodic - @echo `date +%F\ %R:%S` Setting up ALLSKY_HOME environment variable... - @echo "export ALLSKY_HOME=$(HOMEDIR)\nPATH=${PATH}:$(SCRIPTSDIR)" > $(DESTDIR)$(sysconfdir)/profile.d/allsky.sh + @echo "`date +%F\ %R:%S` Setting up ALLSKY_HOME environment variable..." + @echo "export ALLSKY_HOME=$(HOMEDIR)\nPATH=${PATH}:$(SCRIPTSDIR)" > /etc/profile.d/allsky.sh + .PHONY : install -endif # Package build check + endif # Root check diff --git a/install.sh b/install.sh index b6e092bb7..6f13f98c2 100755 --- a/install.sh +++ b/install.sh @@ -1818,9 +1818,9 @@ install_dependencies_etc() ln -s "${F}" "${T}" || echo "Unable to ln -s '${F}' '${T}'" >&2 fi - TMP="${ALLSKY_LOGS}/make_deps.log" - sudo make deps > "${TMP}" 2>&1 - check_success $? "Dependency installation failed" "${TMP}" "${DEBUG}" || + TMP="${ALLSKY_LOGS}/allsky_dependencies.log" + run_aptGet ffmpeg lftp imagemagick bc > "${TMP}" 2>&1 + check_success $? "Allsky dependency installation failed" "${TMP}" "${DEBUG}" || exit_with_image 1 "${STATUS_ERROR}" "dependency installation failed" # Set some default locations needed by the capture programs so we @@ -1830,18 +1830,23 @@ install_dependencies_etc() -e "s;XX_ALLSKY_HOME_XX;${ALLSKY_HOME};" \ -e "s;XX_CONNECTED_CAMERAS_FILE_XX;${CONNECTED_CAMERAS_INFO};" \ -e "s;XX_RPI_CAMERA_INFO_FILE_XX;${RPi_SUPPORTED_CAMERAS};" \ - "${ALLSKY_HOME}/src/include/allsky_common.h.repo" > "${ALLSKY_HOME}/src/include/allsky_common.h" + "${ALLSKY_HOME}/src/include/allsky_common.h.repo" \ + > "${ALLSKY_HOME}/src/include/allsky_common.h" - display_msg --log progress "Preparing Allsky commands." + # "make -C src deps" may need to install some packages, so needs "sudo". + display_msg --log progress "Creating Allsky commands." TMP="${ALLSKY_LOGS}/make_all.log" - make all > "${TMP}" 2>&1 + { + echo "===== make deps" + sudo make -C src deps && echo -e "\n\n===== make all" && make -C src all + } > "${TMP}" 2>&1 check_success $? "Compile failed" "${TMP}" "${DEBUG}" || exit_with_image 1 "${STATUS_ERROR}" "compile failed" TMP="${ALLSKY_LOGS}/make_install.log" sudo make install > "${TMP}" 2>&1 check_success $? "make install failed" "${TMP}" "${DEBUG}" || - exit_with_image 1 "${STATUS_ERROR}" "make insall_failed" + exit_with_image 1 "${STATUS_ERROR}" "make install failed" STATUS_VARIABLES+=("${FUNCNAME[0]}='true'\n") } diff --git a/notificationImages/Makefile b/notificationImages/Makefile deleted file mode 100644 index f1afbb480..000000000 --- a/notificationImages/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -platform = $(shell uname -m) -prefix = - -sysconfdir = ${prefix}/etc -exec_prefix = /usr -bindir = ${exec_prefix}/bin -libexecdir = ${exec_prefix}/libexec/allsky -sharedir = ${exec_prefix}/share/allsky - -.DEFAULT_GOAL := all - -ROOTCHECK=$(shell id -u) -ifneq ($(ROOTCHECK),0) - ifeq ($(PKGBUILD),1) - ROOTCHECK=0 - endif -endif - -ifeq ($(PKGBUILD),) - PKGBUILD=0 -endif - -%: - @echo `date +%F\ %R:%S` nothing to do for $@... - -ifneq ($(ROOTCHECK), 0) -install uninstall: - @echo This must be run with root permissions. - @echo Please run \'sudo make $@\' - -else - -ifeq ($(PKGBUILD),1) -install: - @echo `date +%F\ %R:%S` Setting up Notification Images... - @if [ ! -e $(DESTDIR)$(sharedir) ] && mkdir -p $(DESTDIR)$(sharedir); fi - @install -m 0644 *.jpg *.png $(DESTDIR)$(sharedir)/ - -uninstall: - @echo `date +%F\ %R:%S` Removing Notification Images... - @rm -rf $(DESTDIR)$(sharedir) - -endif # PKGBUILD -endif # ROOTCHECK diff --git a/scripts/Makefile b/scripts/Makefile deleted file mode 100644 index 397799b08..000000000 --- a/scripts/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -platform = $(shell uname -m) -prefix = - -sysconfdir = ${prefix}/etc -exec_prefix = /usr -bindir = ${exec_prefix}/bin -libexecdir = ${exec_prefix}/libexec/allsky -sharedir = ${exec_prefix}/share/allsky - -.DEFAULT_GOAL := all - -ROOTCHECK=$(shell id -u) -ifneq ($(ROOTCHECK),0) - ifeq ($(PKGBUILD),1) - ROOTCHECK=0 - endif -endif - -ifeq ($(PKGBUILD),) - PKGBUILD=0 -endif - -%: - @echo `date +%F\ %R:%S` nothing to do for $@ - -ifneq ($(ROOTCHECK), 0) -install uninstall: - @echo This must be run with root permissions. - @echo Please run \'sudo make install\' -else - -install: - @echo `date +%F\ %R:%S` Setting up scripts... - @chmod 755 *.sh - @if [ $(PKGBUILD) -eq 1 ]; then \ - [ ! -e $(DESTDIR)$(libexecdir) ] && mkdir -p $(DESTDIR)$(libexecdir); \ - install *.sh $(DESTDIR)$(libexecdir)/; \ - fi - -ifeq ($(PKGBUILD),1) -uninstall: - @echo `date +%F\ %R:%S` Removing scripts... - @rm -rf $(DESTDIR)$(libexecdir) - -endif # PKGBUILD -endif # ROOTCHECK diff --git a/src/Makefile b/src/Makefile index 4b9eb647f..e46d97208 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,44 +1,22 @@ arch = $(shell dpkg --print-architecture) platform = $(shell uname -m) -prefix = -sysconfdir = ${prefix}/etc -exec_prefix = /usr -bindir = ${exec_prefix}/bin -libexecdir = ${exec_prefix}/libexec/allsky -sharedir = ${exec_prefix}/share/allsky +bindir = /usr/bin PDIR = $(shell dirname "$$PWD") MYDIR = $(shell basename "$$PWD") -RIGHTPATH = 1 - -ifneq (src,$(MYDIR)) - RIGHTPATH = 0 -endif - -ifneq (1,$(RIGHTPATH)) - $(error Unexpected directory structure. This should be in allsky/src directory.) -else +ALLSKYBIN = ../bin .DEFAULT_GOAL := all ROOTCHECK=$(shell id -u) -ifneq ($(ROOTCHECK),0) - ifeq ($(PKGBUILD),1) - ROOTCHECK=0 - endif -endif - -ifeq ($(PKGBUILD),) - PKGBUILD=0 -endif PKGPATH=$(shell which pkg-config) - ifneq ($(PKGPATH),) - USB=$(shell pkg-config --exists libusb-1.0 && pkg-config --cflags --libs libusb-1.0) + USB = $(shell pkg-config --exists libusb-1.0 && pkg-config --cflags --libs libusb-1.0) OPENCV = $(shell pkg-config --exists opencv && pkg-config --cflags --libs opencv || (pkg-config --exists opencv4 && pkg-config --cflags --libs opencv4)) endif + DEFS = -D_LIN -D_DEBUG -DGLIBC_20 CFLAGS = -Werror -Wall -Wno-psabi -Wno-unused-result -g -O2 -lpthread -pthread @@ -85,22 +63,9 @@ endif CFLAGS += $(DEFS) $(ZWOSDK) -all:check_deps capture_ZWO capture_RPi startrails keogram sunwait uhubctl +all: check_deps capture_ZWO capture_RPi startrails keogram sunwait uhubctl .PHONY : all -ifneq ($(shell id -u), 0) -deps: - echo This must be run with root permissions. - echo Please run 'sudo make deps' -else -deps: - @echo `date +%F\ %R:%S` Installing build dependencies... - @apt update && apt -y install libopencv-dev libusb-dev libusb-1.0-0-dev ffmpeg lftp imagemagick bc -endif - -.PHONY : deps - - check_deps: ifeq (,$(USB)) $(error Did not find USB Libraries, try 'sudo make deps') @@ -144,86 +109,60 @@ capture_ZWO: capture_ZWO.o allsky_common.o @$(CC) -o $@ $(CFLAGS) capture_ZWO.o allsky_common.o $(OPENCV) -lASICamera2 $(USB) @echo `date +%F\ %R:%S` Done. -capture_RPi:capture_RPi.o allsky_common.o mode_mean.o +capture_RPi: capture_RPi.o allsky_common.o mode_mean.o @echo `date +%F\ %R:%S` Building $@ program... @$(CC) -o $@ $(CFLAGS) capture_RPi.o allsky_common.o $(OPENCV) mode_mean.o @echo `date +%F\ %R:%S` Done. -keogram:keogram.cpp +keogram: keogram.cpp @echo `date +%F\ %R:%S` Building $@ program... @$(CC) $@.cpp -o $@ $(CFLAGS) $(OPENCV) @echo `date +%F\ %R:%S` Done. -startrails:startrails.cpp +startrails: startrails.cpp @echo `date +%F\ %R:%S` Building $@ program... @$(CC) $@.cpp -o $@ $(CFLAGS) $(OPENCV) @echo `date +%F\ %R:%S` Done. -uhubctl:uhubctl.c +uhubctl: uhubctl.c @echo `date +%F\ %R:%S` Building $@ program... # This comes from the uhubctl Makefile: @cc -g -O0 -Wall -Wextra -std=c99 -pedantic -DPROGRAM_VERSION=\"2.5.0\" -I/usr/include/libusb-1.0 $@.c -o $@ -Wl,-zrelro,-znow -lusb-1.0 @echo `date +%F\ %R:%S` Done. -symlink: all - @echo `date +%F\ %R:%S` Symlinking binaries... - @ln -s $$PWD/capture_ZWO ../bin/ - @ln -s $$PWD/capture_RPi ../bin/ - @ln -s $$PWD/keogram ../bin/ - @ln -s $$PWD/startrails ../bin/ - @ln -s $$PWD/uhubctl ../bin/ - -.PHONY: symlink - ifneq ($(ROOTCHECK), 0) -install uninstall: - @echo This must be run with root permissions. - @echo Please run 'sudo make $@' +deps install uninstall: + @echo "This must be run with root permissions." + @echo "Please run 'sudo make $@'." else +deps: + @echo "`date +%F\ %R:%S` Installing build dependencies..." + @apt -y install libopencv-dev libusb-dev libusb-1.0-0-dev + install: - @echo `date +%F\ %R:%S` Copying binaries... - @if [ $(PKGBUILD) -eq 1 ]; then \ - [ ! -e $(DESTDIR)$(bindir) ] && mkdir -p $(DESTDIR)$(bindir); \ - install capture_ZWO $(DESTDIR)$(bindir); \ - install capture_RPi $(DESTDIR)$(bindir); \ - install keogram $(DESTDIR)$(bindir); \ - install startrails $(DESTDIR)$(bindir); \ - install uhubctl $(DESTDIR)$(bindir); \ - else \ - [ ! -e ../bin ] && mkdir -p ../bin; \ - install -o $(SUDO_USER) -g $(SUDO_USER) capture_ZWO ../bin/; \ - install -o $(SUDO_USER) -g $(SUDO_USER) capture_RPi ../bin/; \ - install -o $(SUDO_USER) -g $(SUDO_USER) keogram ../bin/; \ - install -o $(SUDO_USER) -g $(SUDO_USER) startrails ../bin/; \ - install -o $(SUDO_USER) -g $(SUDO_USER) uhubctl ../bin/; \ - fi - @install sunwait $(DESTDIR)$(bindir) + @echo "`date +%F\ %R:%S` Copying binaries..." + @if [ ! -e $(ALLSKYBIN) ]; then mkdir -p $(ALLSKYBIN); fi + @install -o $(SUDO_USER) -g $(SUDO_USER) capture_ZWO $(ALLSKYBIN)/ + @install -o $(SUDO_USER) -g $(SUDO_USER) capture_RPi $(ALLSKYBIN)/ + @install -o $(SUDO_USER) -g $(SUDO_USER) keogram $(ALLSKYBIN)/ + @install -o $(SUDO_USER) -g $(SUDO_USER) startrails $(ALLSKYBIN)/ + @install -o $(SUDO_USER) -g $(SUDO_USER) uhubctl $(ALLSKYBIN)/ + @install sunwait $(bindir) uninstall: - @echo `date +%F\ %R:%S` Removing binaries... - @if [ $(PKGBUILD) -eq 1 ]; then \ - rm -f $(DESTDIR)$(bindir)/capture_ZWO; \ - rm -f $(DESTDIR)$(bindir)/capture_RPi; \ - rm -f $(DESTDIR)$(bindir)/keogram; \ - rm -f $(DESTDIR)$(bindir)/startrails; \ - rm -f $(DESTDIR)$(bindir)/sunwait; \ - rm -f $(DESTDIR)$(bindir)/uhubctl; \ - else \ - rm -f ../bin/capture_ZWO; \ - rm -f ../bin/capture_RPi; \ - rm -f ../bin/keogram; \ - rm -f ../bin/startrails; \ - rm -f ../bin/uhubctl; \ - fi + @echo "`date +%F\ %R:%S` Removing binaries..." + @rm -f $(ALLSKYBIN)/capture_ZWO + @rm -f $(ALLSKYBIN)/capture_RPi + @rm -f $(ALLSKYBIN)/keogram + @rm -f $(ALLSKYBIN)/startrails + @rm -f $(ALLSKYBIN)/uhubctl endif # sudo / root check -.PHONY : install uninstall +.PHONY : deps install uninstall clean: rm -f capture_ZWO capture_RPi startrails keogram sunwait uhubctl *.o *.a .PHONY : clean -endif # Correct directory structure check - %: - @echo `date +%F\ %R:%S` nothing to do for $@ + @echo "`date +%F\ %R:%S` nothing to do for $@"