lix-os/makefile

45 lines
915 B
Makefile

# there are many ways to lix-os. this is one of them.
#
BINDIR ?= /usr/bin
GITBASE ?= $(shell realpath $(shell git config --get remote.origin.url) | rev \
| cut -d/ -f2- | rev)
REPOS := src vercmp shsort how chin lmr lyr lix
SUBREPOS := vercmp/format how/pkg
BINS := $(foreach repo,$(REPOS),$(BINDIR)/$(repo))
.PHONY: default install all-repos
define git_clone
git clone $(GITBASE)/$1 $1
endef
default: all-repos .gitignore
install: $(BINS)
$(REPOS):
$(call git_clone,$@)
all-repos: $(REPOS) $(SUBREPOS) utilities
$(BINS): all-repos
cd $(shell basename $@) && make install
utilities:
git clone $(GITBASE)/lix-os-utilities utilities
vercmp/format:
cd vercmp && make lix-os-vercmp
how/default:
cd how && make lix-os-defaults
how/pkg:
cd how && make lix-os-pkgs
src/pkg:
cd src && make lix-os-pkgs
.gitignore:
$(shell echo "$(REPOS) utilities .gitignore" | tr ' ' "\\n" > .gitignore)