forked from Loongson-Cloud-Community/dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile-new.template
40 lines (32 loc) · 996 Bytes
/
Makefile-new.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# This file is generated by the template.
REGISTRY?=T_REGISTRY
ORGANIZATION?=T_ORGANIZATION
REPOSITORY?=T_REPOSITORY
TAG?=T_TAG
LATEST?=true
IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG)
LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest
# SOURCE_URL is a url to download source, such as https://github.com/merore/merore.git.
# SOURCE is project sources, its located at src/$(SORUCE).
# PATCH is a patch that supports loong64 to $(SOURCE).
# Be sure to fill in the follows!!!
SOURCE_URL=
SOURCE=$(shell echo $(SOURCE_URL) | awk -F '/' '{print $$NF}' | awk -F '.' '{print $$1}')
PATCH=0001-port-to-loong64.patch
default: image
image: src/$(SOURCE)
# Commands for building.
$(MAKE) -C src/$(SOURCE)
src/$(SOURCE):
git clone -q -b $(TAG) --depth=1 $(SOURCE_URL) $@
cd $@ && \
git apply ../../$(PATCH)
push:
docker push $(IMAGE)
@if [ $(LATEST) = "true" ]; \
then\
docker tag $(IMAGE) $(LATEST_IMAGE); \
docker push $(LATEST_IMAGE); \
fi
clean:
rm -rf src