44 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
| ##
 | |
| # 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
 | |
| REDIS_PORT = 5555
 | |
| 
 | |
| # if we need to run just one time, with all dependencies built first
 | |
| .PHONY: run
 | |
| run: tailwindcss
 | |
| 	go run . --redisPort $(REDIS_PORT)
 | |
| 
 | |
| # 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=.css -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)
 | |
| 
 | |
| .PHONY: test
 | |
| test:
 | |
| 	wgo -file=.go go test ./...
 | |
| # end
 | |
| 
 | |
| .PHONY: run/redis-server
 | |
| run/redis-server:
 | |
| 	redis-server --port $(REDIS_PORT) --notify-keyspace-events KEA
 |