-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (42 loc) · 1.44 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#######################################
# MAKEFILE-PROJECT OPTIONS
#######################################
DIR_PRJ_ROOT :=.
USE_GLOBAL_COMPILE :=
USE_GLOBAL_PLUGIN_COMPILE :=
#######################################
# BOOTSTRAP
#######################################
DIR_PRJ_ROOT ?= .
#######################################
# DIR_MAKEJS
# find out if we are in dev mode or using this as a npm package
# :( make 4.1 does not have .SHELLSTATUS
_PACKAGE_NAME_S := $(shell npm run env 2>/dev/null 1>/dev/null; echo $$?)
ifneq ($(_PACKAGE_NAME_S),0)
$(error no npm package found in this directory $(CURDIR))
endif
_PACKAGE_NAME := $(shell npm run env | grep ^npm_package_name= | cut -d= -f2)
ifeq ($(_PACKAGE_NAME),makefile-for-js ) #will have one trailing space; make eats up one space; so need two spaces
DIR_MAKEJS := $(DIR_PRJ_ROOT)
else
DIR_MAKEJS := $(DIR_PRJ_ROOT)/node_modules/makefile-for-js
endif
ifndef DIR_MAKEJS
$(error could not find makefile-for-js)
endif
#######################################
# FILES and DIRECS
#######################################
#######################################
# RULES
#######################################
######################################
# INCLUDE
######################################
include $(DIR_MAKEJS)/lib/project.makefile
include $(DIR_MAKEJS)/lib/common.makefile
.DEFAULT_GOAL := help
######################################
# YOUR RULES and OVERIDES
######################################