-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dadef94
commit f788563
Showing
2 changed files
with
51 additions
and
4 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 |
---|---|---|
@@ -1,11 +1,45 @@ | ||
all: test run | ||
GO ?= go | ||
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO") | ||
SQLITE3 ?= sqlite3 | ||
HAS_SQLITE3 = $(shell hash $(SQLITE3) > /dev/null 2>&1 && echo "SQLITE3" || echo "NOSQLITE3") | ||
|
||
build: | ||
go build github.com/littlebutt/nasu/src | ||
ifeq ($(OS), Windows_NT) | ||
GOFLAGS := -v -buildmode=exe | ||
EXECUTABLE ?= nasu.exe | ||
else ifeq ($(OS), Windows) | ||
GOFLAGS := -v -buildmode=exe | ||
EXECUTABLE ?= nasu.exe | ||
else | ||
GOFLAGS := -v | ||
EXECUTABLE ?= nasu | ||
endif | ||
|
||
.PHONY: all | ||
|
||
all: check-env run | ||
|
||
check-env: | ||
@echo "checking go..." | ||
ifeq ($(HAS_GO), NOGO) | ||
@echo "GO is not installed" | ||
exit -1 | ||
else | ||
@echo "GO is installed" | ||
endif | ||
@echo "checking sqlite3..." | ||
ifeq ($(HAS_SQLITE3), NOSQLITE3) | ||
@echo "sqlite3 is not installed" | ||
exit -1 | ||
else | ||
@echo "sqlite3 is installed" | ||
endif | ||
|
||
build: check-env | ||
go build -o $(EXECUTABLE) github.com/littlebutt/nasu/src | ||
|
||
test: | ||
go test -cover ./... | ||
|
||
run: | ||
run: check-env | ||
go run github.com/littlebutt/nasu/src | ||
|
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,13 @@ | ||
|
||
build: clean | ||
npm run build | ||
mv build/index.html build/index.htm #go default behaviour | ||
mv build ../src/web | ||
|
||
clean: | ||
rm -rf ../src/web | ||
|
||
|
||
run: | ||
npm run start | ||
|