Skip to content

Commit

Permalink
Made a bunch of PHONY stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxkidd committed Oct 6, 2021
1 parent 4edfa9a commit cd7e927
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ endif
deps:
@make -C src $@

.PHONY : deps

install:
ifneq ($(ROOTCHECK), 0)
@echo This must be run with root permissions.
Expand All @@ -54,3 +56,4 @@ else
echo ""; \
fi
endif
.PHONY : install
9 changes: 9 additions & 0 deletions config_repo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ createDirs:
@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

$(CONFIGFILES):
@if [ ! -e $(DESTDIR)$(sysconfdir)/allsky/$@ ]; then \
echo `date +%F\ %R:%S` Copying default $@; \
install -m 0644 $@.repo $(DESTDIR)$(sysconfdir)/allsky/$@; \
fi
.PHONY : $(CONFIGFILES)

install: createDirs $(CONFIGFILES)
@echo `date +%F\ %R:%S` Setting up udev rules...
Expand All @@ -80,15 +83,20 @@ remove_configs:
@echo `date +%F\ %R:%S` Removing config path and files ../config
@rm -rf ../config

.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

.PHONY : createDirs

$(CONFIGFILES):
@if [ ! -e ../config/$@ ]; then \
echo `date +%F\ %R:%S` Copying default $@; \
install -m 0644 -o $(SUDO_USER) -g $(SUDO_USER) $@.repo ../config/$@; \
fi
.PHONY : $(CONFIGFILES)

install: createDirs $(CONFIGFILES)
@echo `date +%F\ %R:%S` Setting up udev rules...
Expand All @@ -108,5 +116,6 @@ install: createDirs $(CONFIGFILES)
@echo `date +%F\ %R:%S` Setting up home environment variable...
@echo "export ALLSKY_HOME=$(PDIR)" > $(DESTDIR)$(sysconfdir)/profile.d/allsky.sh
@echo `date +%F\ %R:%S` Copying default ftp-settings.sh
.PHONY : install
endif # Package build check
endif # Root check
6 changes: 5 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ else
@apt update && apt -y install libopencv-dev libusb-dev libusb-1.0-0-dev ffmpeg gawk lftp jq imagemagick
endif

.PHONY : deps

USB=$(shell pkg-config --cflags --libs libusb-1.0)
ifeq (,$(USB))
$(error Did not find USB Libraries, try 'make deps')
Expand Down Expand Up @@ -99,6 +101,7 @@ CFLAGS += $(DEFS) $(ZWOSDK)
@echo `date +%F\ %R:%S` nothing to do for $@

all:capture capture_RPiHQ startrails keogram sunwait
.PHONY : all

sunwait:
@echo `date +%F\ %R:%S` Initializing sunwait submodule...
Expand Down Expand Up @@ -176,9 +179,10 @@ uninstall:
fi

endif # sudo / root check
.PHONY : install uninstall

clean:
rm -f capture capture_RPiHQ startrails keogram *.o *.a

.PHONY : clean

endif # Correct directory structure check

0 comments on commit cd7e927

Please sign in to comment.