include Makefile.inc
DIRSRC = src

DIRMAN = man

DIRSCRIPTS = scripts

DIRDOC = doc

DIRSERVICES = services

.PHONY: all


all:
	$(MAKE) -C $(DIRSRC)

install: all

	$(MAKE) -C $(DIRSRC) install
	$(MAKE) -C $(DIRSCRIPTS) install
	$(MAKE) -C $(DIRMAN) install

man:
	$(MAKE) -C $(DIRMAN) install

clean:

	$(MAKE) -C $(DIRSRC) clean

install-sysd-%:
	$(MAKE) -C $(DIRSERVICES)/sysd $@

install-sysv-%:
	$(MAKE) -C $(DIRSERVICES)/sysv $@

install-runyx-%:
	$(MAKE) -C $(DIRSERVICES)/runyx $@

uninstall-sysd-%:
	$(MAKE) -C $(DIRSERVICES)/sysd $@

uninstall-sysv-%:
	$(MAKE) -C $(DIRSERVICES)/sysv $@


uninstall-runyx-%:
	$(MAKE) -C $(DIRSERVICES)/runyx $@

dist: distclean

	git archive --format=tar --prefix=$(NAME)/ HEAD | tar -x
	git log > $(NAME)/ChangeLog
	tar cJvf $(NAME).tar.xz $(NAME)
	rm -rf $(NAME)

distclean:
	rm -rf $(NAME).tar.xz
