You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
website/Makefile

37 lines
694 B
Makefile

JS_SOURCES = $(wildcard frontend/src/*.js)
JS_OUTPUTS = $(patsubst frontend/src/%.js, public/js/%.min.js, $(JS_SOURCES))
SERVER_EXECUTABLE = phc-website-server
.PHONY: all
all: js go
#
# Build Frontend
#
.PHONY: js
js: $(JS_OUTPUTS)
@echo "Compiled Frontend"
public/js/%.min.js: frontend/src/%.js
cd frontend; rollup -c rollup.config.js
cp $(patsubst frontend/src/%.js, frontend/dist/%.min.js, $<) $@
#
# Build Server
#
.PHONY: go
go: $(SERVER_EXECUTABLE)
@echo "Compiled Server"
$(SERVER_EXECUTABLE):
go build -o $(SERVER_EXECUTABLE) .
.PHONY: debug
debug:
@echo "JS_SOURCES = $(JS_SOURCES)"
@echo "JS_OUTPUTS = $(JS_OUTPUTS)"
@echo "SERVER_EXECUTABLE = $(SERVER_EXECUTABLE)"