This repository has been archived by the owner on Jul 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added general makefile setup to reuse at other packages
- Loading branch information
1 parent
8eca140
commit 095a2b8
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
include ./setup.mk | ||
|
||
help: | ||
@echo "fritzing-js Makefile" | ||
@echo "" | ||
@echo " build build the react app" | ||
@echo " test test the app" | ||
@echo " clean remove the build artifacts" | ||
@echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
ifeq ($(OS),Windows_NT) | ||
BIN=node_modules\.bin | ||
PATHSEP2=\\ | ||
RM=del -r | ||
else | ||
BIN=./node_modules/.bin | ||
PATHSEP2=/ | ||
RM=rm -rf | ||
endif | ||
|
||
# make <target> LOG=yes | ||
ifeq "$(LOG)" "" | ||
LOG=no | ||
endif | ||
|
||
ifeq "$(LOG)" "no" | ||
L=@ | ||
endif | ||
|
||
PATHSEP=$(strip $(PATHSEP2)) | ||
|
||
all: lint test build docs | ||
|
||
# BIN ?= ./node_modules/.bin | ||
# DIR ?= $(dir $(lastword $(MAKEFILE_LIST))) | ||
LINT_SRC_JS ?= . | ||
|
||
lint: | ||
$(L)$(BIN)$(PATHSEP)eslint $(LINT_SRC_JS) | ||
lint-fix: | ||
$(L)$(BIN)$(PATHSEP)eslint $(LINT_SRC_JS) --fix | ||
.PHONY: lint lint-fix | ||
|
||
vars: | ||
@echo $(OS) | ||
@echo $(LOG) | ||
@echo $(BIN) | ||
@echo $(PATHSEP) | ||
@echo $(RM) | ||
|
||
test: | ||
$(L)$(BIN)$(PATHSEP)jest | ||
open-coverage: test | ||
$(L)open coverage$(PATHSEP)lcov-report$(PATHSEP)index.html | ||
.PHONY: test open-coverage | ||
|
||
build: | ||
$(L)$(BIN)$(PATHSEP)babel -o lib$(PATHSEP)index.js src$(PATHSEP)index.js | ||
.PHONY: build | ||
|
||
docs: | ||
$(L)$(BIN)$(PATHSEP)esdoc | ||
docs-open: docs | ||
$(L)open docs$(PATHSEP)index.html | ||
.PHONY: docs docs-open | ||
|
||
release-commit: build docs | ||
git add lib | ||
git add docs | ||
git commit -m "Updated build artifacts (lib and docs)" | ||
.PHONY: release-commit | ||
|
||
clean: | ||
$(L)$(RM) coverage | ||
.PHONY: clean |