Skip to content

Latest commit

 

History

History
116 lines (77 loc) · 4.56 KB

File metadata and controls

116 lines (77 loc) · 4.56 KB

Transparently including the SemVer implementation

It is possible to automatically download and import the desired makefile-server implementation into your Makefile. This also implies that the file can be .gitignored.

Beware that using this technique may render your Makefile non portable to other platforms depending on the availability of the used command for downloading files.

Basic Template

The idea is to automatically and transparently download a copy of the implementation file only if it's not yet present in the local file system. Without the need of additional commands or actions from the side of the user.

_:=$(or $(wildcard $(THE_FILE)), $(shell $(FETCH_FILE_COMMAND)))
include $(THE_FILE)

Well Known Download Tools

The $(FETCH_FILE_COMMAND) can be anything able to download a file over HTTP/HTTPS, two of the most popular commands being curl and wget

# curl example with silent download
curl -sO {URL}

# wget example with quiet download
wget -q {URL}

This document will use curl since it is a common tool found under Linux, Darwin and Windows 10.

Downloading specific versions

It is recommended to put these lines at the very end of your Makefile

Release Version 0.3.1

Makefile.semver:

_:=$(or $(wildcard Makefile.semver), $(shell curl -sO https://raw.githubusercontent.com/malcos/makefile-semver/0.3.1/Makefile.semver))
include Makefile.semver

Release Version 0.3.0

Makefile.semver:

_:=$(or $(wildcard Makefile.semver), $(shell curl -sO https://raw.githubusercontent.com/malcos/makefile-semver/0.3.0/Makefile.semver))
include Makefile.semver

Release Version 0.2.0

Makefile.semver:

_:=$(or $(wildcard Makefile.semver), $(shell curl -sO https://raw.githubusercontent.com/malcos/makefile-semver/0.2.0/Makefile.semver))
include Makefile.semver

Release Version 0.1.0

Makefile.semver-complete:

_:=$(or $(wildcard Makefile.semver-complete), $(shell curl -sO https://raw.githubusercontent.com/malcos/makefile-semver/0.1.0/Makefile.semver-complete))
include Makefile.semver-complete

Makefile.semver-basic:

_:=$(or $(wildcard Makefile.semver-basic), $(shell curl -sO https://raw.githubusercontent.com/malcos/makefile-semver/0.1.0/Makefile.semver-basic))
include Makefile.semver-basic

Release Version 0.0.3

Makefile.semver-complete:

_:=$(or $(wildcard Makefile.semver-complete), $(shell curl -sO https://raw.githubusercontent.com/malcos/makefile-semver/0.0.3/Makefile.semver-complete))
include Makefile.semver-complete

Makefile.semver-basic:

_:=$(or $(wildcard Makefile.semver-basic), $(shell curl -sO https://raw.githubusercontent.com/malcos/makefile-semver/0.0.3/Makefile.semver-basic))
include Makefile.semver-basic

Release Version 0.0.2

Make.semver-cycles:

_:=$(or $(wildcard Make.semver-cycles), $(shell curl -sO https://raw.githubusercontent.com/malcos/makefile-semver/0.0.2/Make.semver-cycles))
include Make.semver-cycles

Make.semver-simple:

_:=$(or $(wildcard Make.semver-simple), $(shell curl -sO https://raw.githubusercontent.com/malcos/makefile-semver/0.0.2/Make.semver-simple))
include Make.semver-simple

Release Version 0.0.1

Make.semver-simple:

_:=$(or $(wildcard Make.semver-simple), $(shell curl -sO https://raw.githubusercontent.com/malcos/makefile-semver/0.0.1/Make.semver-simple))
include Make.semver-simple