pthbs

Packaging Through Hashed Build Scripts
git clone https://ccx.te2000.cz/git/pthbs
Log | Files | Refs | Submodules | README

pthbs.mk (1495B)


      1 # default to homedir if not root
      2 versions?=$(patsubst /root/%,/%,$(HOME)/versions)
      3 pthbs?=.
      4 packages?=packages
      5 work?=work
      6 cache?=cache
      7 index?=index
      8 
      9 export PATH:=$(abspath $(pthbs))/command:$(PATH)
     10 export pthbs_versions:=$(versions)
     11 export pthbs_pkgdir:=$(abspath $(packages))
     12 export pthbs_workdir:=$(abspath $(work))
     13 export pthbs_indexdir:=$(abspath $(index))
     14 export pthbs_cache:=$(abspath $(cache))
     15 export pthbs_source:=$(abspath $(pthbs))
     16 
     17 no_default:
     18 	@echo "pthbs has no default target to build"
     19 
     20 $(versions)/environment.%/.env:
     21 	@echo mkdir "$$(dirname '$@')"
     22 	@echo touch '$@'
     23 
     24 
     25 %/.exists:
     26 	mkdir -p '$*'
     27 	touch '$@'
     28 
     29 
     30 $(cache)/link/file-%/.local: $(index)/filelist.% $(cache)/link/file-%/.exists
     31 	pthbs-link-from-index '$(cache)/link/file-$*/' '$(index)/filelist.$*'
     32 
     33 $(cache)/link/git-commit-%/.local: $(index)/commitlist.% $(cache)/link/git-commit-%/.exists
     34 	pthbs-link-from-index '$(cache)/link/git-commit-$*/' '$(index)/commitlist.$*'
     35 
     36 $(cache)/make/package.%.mk: $(packages)/% $(cache)/make/.exists $(pthbs)/command/pthbs-makegen
     37 	pthbs-makegen '$(packages)/$*' >'$@.new'
     38 	mv '$@.new' '$@'
     39 
     40 $(cache)/make/downloads.%.mk: downloadlist.% $(cache)/make/.exists $(pthbs)/command/pthbs-makegen-downloads
     41 	pthbs-makegen-downloads '$*' 'downloadlist.$*' >'$@.new'
     42 	mv '$@.new' '$@'
     43 
     44 include $(cache)/make/downloads.sha256.mk
     45 
     46 pkg_files=$(wildcard packages/*)
     47 #env_files=$(wildcard environments/*)
     48 mk_files=$(patsubst packages/%,$(cache)/make/package.%.mk,$(pkg_files))
     49 include $(mk_files)