diff options
Diffstat (limited to 'build.mk')
| -rw-r--r-- | build.mk | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -2,18 +2,29 @@ # # TODO: # - rules for pre-req dependencies -# - rules to build and maintain patches +# - rules to build patches from .orig # - rules to run tests before installing # - build and run in chroot +# - detect inflate command +# +# Done: +# - rules to apply patches # arc ?= $(notdir $(url)) configure_cmd ?= ./configure build_cmd ?= make -inflate_cmd ?= gunzip install_cmd ?= sudo make install uninstall_cmd ?= sudo make uninstall +ifeq ($(suffix $(arc)), .gz) + inflate_cmd ?= gzip -cd +else ifeq ($(suffix $(arc)), .xz) + inflate_cmd ?= xz -cd +else ifeq ($(suffix $(arc)), .bz2) + inflate_cmd ?= bzip2 -cd +endif + ifdef git_url fetch_cmd = git clone --depth=1 $(git_url) extract_cmd = : @@ -25,7 +36,7 @@ else endif clean: - rm -rf .install .build .configure .extract .fetch $(dir) + rm -rf .install .build .patched .configure .extract .fetch $(dir) debug: @echo arc = $(arc) @@ -55,7 +66,7 @@ fetch: .fetch @touch $@ .patched: .extract - cd $(dir) && for f in ../*.patch; do patch -p1 < $$f || break; done + for f in $$(ls *.patch); do (cd $(dir) && patch -p1 < ../$$f) || break; done @touch $@ .extract: .fetch |
