2018-12-18 18:04:42 +00:00
|
|
|
# List any generated files here
|
|
|
|
TARGETS = ../ui/src/api/api.ts
|
|
|
|
# List any source files used to generate the targets here
|
|
|
|
SOURCES = cur_swagger.yml
|
|
|
|
# List any directories that have their own Makefile here
|
|
|
|
SUBDIRS =
|
|
|
|
|
|
|
|
# Default target
|
|
|
|
all: $(SUBDIRS) $(TARGETS)
|
|
|
|
|
|
|
|
# Recurse into subdirs for same make goal
|
|
|
|
$(SUBDIRS):
|
|
|
|
$(MAKE) -C $@ $(MAKECMDGOALS)
|
|
|
|
|
|
|
|
# Clean all targets recursively
|
|
|
|
clean: $(SUBDIRS)
|
|
|
|
rm -f $(TARGETS)
|
|
|
|
|
2018-12-20 19:17:02 +00:00
|
|
|
|
|
|
|
GO_RUN := env GO111MODULE=on go run
|
|
|
|
|
2018-12-18 18:04:42 +00:00
|
|
|
../ui/src/api/api.ts: $(SOURCES)
|
2018-12-20 19:17:02 +00:00
|
|
|
cat cur_swagger.yml | $(GO_RUN) ../internal/yaml2json > openapi.json
|
2018-12-18 18:04:42 +00:00
|
|
|
openapi-generator generate -g typescript-axios -o ../ui/src/api -i openapi.json
|
|
|
|
rm openapi.json
|
|
|
|
|
|
|
|
.PHONY: all clean $(SUBDIRS)
|