Skip to content

Commit

Permalink
Add makefile for generate codes
Browse files Browse the repository at this point in the history
  • Loading branch information
liut committed Mar 11, 2022
1 parent da2cb0e commit eab11f7
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.SILENT :
.PHONY: docs


GO=$(shell which go)
GOMOD=$(shell echo "$${GO111MODULE:-auto}")


MDs=apis.md \
chat_info.md \
dept_info.md \
external_contact.md \
media_upload.md \
oa.md \
rx_msg.md \
user_info.md

help:
echo "make errcodegen | sdkcodegen"

docs:
$(info docs: $(MDs))

generate:
GO111MODULE=$(GOMOD) $(GO) generate ./...

errcodegen:
GO111MODULE=$(GOMOD) $(GO) run -tags=sdkcodegen ./internal/errcodegen errcodes/mod.go

sdkcodegen:
for name in $(MDs); do \
echo $${name}; \
GO111MODULE=$(GOMOD) $(GO) run -tags=sdkcodegen ./internal/sdkcodegen docs/$${name} $${name}.go ; \
done

0 comments on commit eab11f7

Please sign in to comment.