init: gnumake for live restarts on src \ tailwind
This commit is contained in:
35
Makefile
Normal file
35
Makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
##
|
||||
# Project Title
|
||||
# Some Automoderation
|
||||
#
|
||||
# @file
|
||||
# @version 0.1
|
||||
TEMPLATES = $(wildcard routes/templates/*.gohtml routes/templates/**/*.gohtml)
|
||||
TAILWIND_OUT = routes/static/out.css
|
||||
TAILWIND_IN = routes/in.css
|
||||
TAILWIND_CONF = tailwind.config.js
|
||||
|
||||
# if we need to run just one time, with all dependencies built first
|
||||
.PHONY: run
|
||||
run: tailwindcss
|
||||
go run .
|
||||
|
||||
# this uses wgo to re-execute 'make run'
|
||||
# which will toggle tailwind out.css build only if necessery
|
||||
# and then do `go run .` to rebuild all else
|
||||
.PHONY: run/live
|
||||
run/live:
|
||||
wgo -verbose -file=.go -file=.gohtml -file=$(TAILWIND_CONF) make run
|
||||
|
||||
# this is alias to concrete task that will build out.css
|
||||
.PHONY: tailwindcss
|
||||
tailwindcss: $(TAILWIND_OUT)
|
||||
|
||||
# this is concrete task to build out.css file
|
||||
# having as 'concrete' allows to not rebuild the output when inputs haven't changed
|
||||
# then having .PHONY tailwindcss is easier to specify as dependency,
|
||||
# but also i think phony tasks are "always" executed when depended upon
|
||||
$(TAILWIND_OUT): $(TEMPLATES) $(TAILWIND_IN) $(TAILWIND_CONF)
|
||||
tailwindcss -i $(TAILWIND_IN) -o $(TAILWIND_OUT)
|
||||
|
||||
# end
|
||||
Reference in New Issue
Block a user