Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 1.02 KB

File metadata and controls

65 lines (45 loc) · 1.02 KB

makefile

Back{: .button}

Learnings

Auto Linking programs

main: a.o b.o

RECIPEPREFIX

By default Makefiles are with tabs. The RECIPEPREFIX can be used to change it

ifeq ($(origin .RECIPEPREFIX), undefined)
  $(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >

build:
> npm install
> npm build

DELETE_ON_ERROR

If the Make rule fails, it's target file is destroyed

.DELETE_ON_ERROR:
.RECIPEPREFIX = >

build:
> npm install
> npm build

ONESHELL

Makes the recipe is run as one single shell session, rather than one new shell per line

.ONESHELL:
.RECIPEPREFIX = >

build:
> npm install
> npm build

Makeflags

MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules

References