From 630e7e52961e7570bad504efb5107f13d661ecd6 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw)" <3293172751nss@gmail.com> Date: Thu, 11 May 2023 01:34:15 +0800 Subject: [PATCH] feat: refactor the makefile to initialize the base modules Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> --- script/make-rules/common.mk | 17 +++++++++++++++++ script/make-rules/copyright.mk | 18 ++++++++++++++++++ script/make-rules/dependencies.mk | 17 +++++++++++++++++ script/make-rules/gen.mk | 19 +++++++++++++++++++ script/make-rules/golang.mk | 17 +++++++++++++++++ script/make-rules/image.mk | 21 +++++++++++++++++++++ script/make-rules/tools.mk | 18 ++++++++++++++++++ 7 files changed, 127 insertions(+) create mode 100644 script/make-rules/common.mk create mode 100644 script/make-rules/copyright.mk create mode 100644 script/make-rules/dependencies.mk create mode 100644 script/make-rules/gen.mk create mode 100644 script/make-rules/golang.mk create mode 100644 script/make-rules/image.mk create mode 100644 script/make-rules/tools.mk diff --git a/script/make-rules/common.mk b/script/make-rules/common.mk new file mode 100644 index 000000000..6e0314402 --- /dev/null +++ b/script/make-rules/common.mk @@ -0,0 +1,17 @@ +# Copyright © 2023 OpenIMSDK. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ============================================================================== +# Makefile helper functions for common tasks +# \ No newline at end of file diff --git a/script/make-rules/copyright.mk b/script/make-rules/copyright.mk new file mode 100644 index 000000000..052159e10 --- /dev/null +++ b/script/make-rules/copyright.mk @@ -0,0 +1,18 @@ +# Copyright © 2023 OpenIMSDK. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============================================================================== +# wget https://github.com/google/addlicense/releases/download/v1.0.0/addlicense_1.0.0_Linux_x86_64.tar.gz +# Makefile helper functions for copyright +# \ No newline at end of file diff --git a/script/make-rules/dependencies.mk b/script/make-rules/dependencies.mk new file mode 100644 index 000000000..bd6568713 --- /dev/null +++ b/script/make-rules/dependencies.mk @@ -0,0 +1,17 @@ +# Copyright © 2023 OpenIMSDK. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ============================================================================== +# Makefile helper functions for dependencies +# \ No newline at end of file diff --git a/script/make-rules/gen.mk b/script/make-rules/gen.mk new file mode 100644 index 000000000..61489373b --- /dev/null +++ b/script/make-rules/gen.mk @@ -0,0 +1,19 @@ +# Copyright © 2023 OpenIMSDK. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ============================================================================== +# Makefile helper functions for generate necessary files and docs +# https://cloud.redhat.com/blog/kubernetes-deep-dive-code-generation-customresources +# ! The stock of code generated by `make gen` should be idempotent +# \ No newline at end of file diff --git a/script/make-rules/golang.mk b/script/make-rules/golang.mk new file mode 100644 index 000000000..d140e86f8 --- /dev/null +++ b/script/make-rules/golang.mk @@ -0,0 +1,17 @@ +# Copyright © 2023 OpenIMSDK. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ============================================================================== +# Build management helpers. These functions help to set, save and load the +# \ No newline at end of file diff --git a/script/make-rules/image.mk b/script/make-rules/image.mk new file mode 100644 index 000000000..0eb46137e --- /dev/null +++ b/script/make-rules/image.mk @@ -0,0 +1,21 @@ +# Copyright © 2023 OpenIMSDK. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ============================================================================== +# Makefile helper functions for docker image +# TODO: For the time being only used for compilation, it can be arm or amd, please do not delete it, it can be extended with new functions +# ============================================================================== +# Path: scripts/make-rules/image.mk +# docker registry: registry.example.com/namespace/image:tag as: registry.hub.docker.com/cubxxw/: +# \ No newline at end of file diff --git a/script/make-rules/tools.mk b/script/make-rules/tools.mk new file mode 100644 index 000000000..25f049441 --- /dev/null +++ b/script/make-rules/tools.mk @@ -0,0 +1,18 @@ +# Copyright © 2023 OpenIMSDK. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ============================================================================== +# Makefile helper functions for tools(https://github.com/avelino/awesome-go) -> DIR: {TOOT_DIR}/tools | (go >= 1.19) +# Why download to the tools directory, thinking we might often switch Go versions using gvm. +#