-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
61 lines (44 loc) · 1.72 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
54
55
56
57
58
59
60
61
# $@: $<
## prologue
# ----------------------------------------------------------------------------------------------------------------------
#
MAKEFLAGS += --warn-undefined-variables
MAKE := /usr/bin/make
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := compile
.SUFFIXES:
## Always use GNU Make
# ----------------------------------------------------------------------------------------------------------------------
#
MAKE_VERSION := $(shell $(MAKE) --version)
ifneq ($(firstword $(MAKE_VERSION)),GNU)
$(error Use GNU Make)
endif
# ----------------------------------------------------------------------------------------------------------------------
CWD := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
NODE ?= node
NPM ?= npm
NODE_PATH=build
# Project specific vars
# ----------------------------------------------------------------------------------------------------------------------
BUILD_DIR := build
SOURCE_DIR := lib
TS_FLAGS := --target ES5 --module commonjs
TS_SRC := lib/*.ts
BSF_FLAGS := --standalone mapTools --debug --verbose
BSF_DIR := $(BUILD_DIR)/
BSF_SRC := $(BUILD_DIR)/mapTools.js
BSF_OUT := dist/map-tools.js
# include sub Makefiles
# ----------------------------------------------------------------------------------------------------------------------
include make/common.debug.mk
include make/node.typescript.mk
include make/node.browserify.mk
# app targets calling other targets in sub Makefile
# ----------------------------------------------------------------------------------------------------------------------
.PHONY: compile clean
clean: ts-clean browser-clean
@printf '\e[1;32m %-10s\e[m%s\n' 'done'
compile: ts browser
@printf '\e[1;32m %-10s\e[m%s\n' 'done'