Skip to content

Commit

Permalink
Ignore modification time of the web files when building static assets
Browse files Browse the repository at this point in the history
  • Loading branch information
elwinar committed Mar 11, 2020
1 parent c1ca13e commit 7c1d645
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ldflags="-X main.Version=`git describe --tags`"

.PHONY: help
help: ## Get help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN (FS = ":.*?## "); (printf "\033[36m%-10s\033[0m %s\n", $$1, $$2)'

.PHONY: all
all: install build ## Install dependencies & build all targets
Expand All @@ -23,34 +23,34 @@ build: web rcoredumpd rcoredump monkey ## Build all targets

.PHONY: serve
serve: ## Run the web interface
./node_modules/.bin/parcel -d ${build_dir}/web/ web/index_dev.html --host 0.0.0.0
./node_modules/.bin/parcel -d $(build_dir)/web/ web/index_dev.html --host 0.0.0.0

.PHONY: web
web: ## Build the web interface
rm -rf ${build_dir}/web
./node_modules/.bin/parcel build -d ${build_dir}/web/ web/index.html
rm -rf ${bin_dir}/rcoredumpd/internal
statik -f -src ${build_dir}/web -dest ${bin_dir}/rcoredumpd/ -p internal
rm -rf $(build_dir)/web
./node_modules/.bin/parcel build -d $(build_dir)/web/ web/index.html
rm -rf $(bin_dir)/rcoredumpd/internal
statik -f -src $(build_dir)/web -dest $(bin_dir)/rcoredumpd/ -p internal -m

.PHONY: rcoredumpd
rcoredumpd: ## Build the server
go build -o ${build_dir} -ldflags $(ldflags) ${bin_dir}/rcoredumpd
go build -o $(build_dir) -ldflags $(ldflags) $(bin_dir)/rcoredumpd

.PHONY: rcoredump
rcoredump: ## Build the client
go build -o ${build_dir} -ldflags $(ldflags) ${bin_dir}/rcoredump
go build -o $(build_dir) -ldflags $(ldflags) $(bin_dir)/rcoredump

.PHONY: monkey
monkey: ## Build the test crashers
go build -o ${build_dir} ${bin_dir}/monkey-go
gcc -o ${build_dir}/monkey-c ${bin_dir}/monkey-c/*.c
go build -o $(build_dir) $(bin_dir)/monkey-go
gcc -o $(build_dir)/monkey-c $(bin_dir)/monkey-c/*.c

targets=linux/amd64,linux/386
pkg=github.com/elwinar/rcoredump/bin

.PHONY: release
release: ## Build the release files
rm -rf ${release_dir}
xgo --dest=${release_dir} --targets=$(targets) --ldflags=$(ldflags) $(pkg)/rcoredumpd
xgo --dest=${release_dir} --targets=$(targets) --ldflags=$(ldflags) $(pkg)/rcoredump
rm -rf $(release_dir)
xgo --dest=$(release_dir) --targets=$(targets) --ldflags=$(ldflags) $(pkg)/rcoredumpd
xgo --dest=$(release_dir) --targets=$(targets) --ldflags=$(ldflags) $(pkg)/rcoredump

2 changes: 1 addition & 1 deletion bin/rcoredumpd/internal/statik.go

Large diffs are not rendered by default.

0 comments on commit 7c1d645

Please sign in to comment.