blob: cdca8f13248aff24acc908e65058309c90df198c [file] [log] [blame]
Harald Welte0cdf0712019-06-19 18:15:38 +02001# Copyright 2017 Harald Welte
2# Copyright 2018 sysmocom - s.f.m.c. GmbH
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Harald Welte68079822017-12-12 16:30:53 +010015
16ECLIPSEGIT:=https://github.com/eclipse
17ECLIPSEGIT2:=git://git.eclipse.org/gitroot/titan
Harald Welte701b5742018-01-22 11:29:13 +010018OSMOGITHUB:=https://github.com/osmocom
Harald Welte3103fce2018-05-26 13:58:31 +020019OSMOGIT:=git://git.osmocom.org
Harald Welte68079822017-12-12 16:30:53 +010020
21ECLIPSEGIT_REPOS= titan.Libraries.TCCUsefulFunctions \
22 titan.ProtocolModules.ICMP \
23 titan.ProtocolModules.ICMPv6 \
24 titan.ProtocolModules.IP \
25 titan.ProtocolModules.L2TP \
26 titan.ProtocolModules.M3UA \
Harald Welte36296dc2018-04-16 17:37:31 +020027 titan.ProtocolModules.SMPP \
Harald Welte68079822017-12-12 16:30:53 +010028 titan.ProtocolModules.TCP \
29 titan.ProtocolModules.UDP \
30 titan.ProtocolModules.RTP \
31 titan.TestPorts.Common_Components.Socket-API \
32 titan.TestPorts.IPL4asp \
33 titan.TestPorts.LANL2asp \
34 titan.TestPorts.PCAPasp \
Harald Welte68079822017-12-12 16:30:53 +010035 titan.TestPorts.SIPmsg \
36 titan.TestPorts.TCPasp \
37 titan.TestPorts.TELNETasp \
Harald Weltea28dce12018-04-14 22:04:05 +020038 titan.TestPorts.UDPasp \
39 titan.TestPorts.UNIX_DOMAIN_SOCKETasp
Harald Welte68079822017-12-12 16:30:53 +010040
41ECLIPSEGIT2_REPOS= titan.ProtocolModules.GRE \
42 titan.ProtocolModules.M2PA \
Harald Welte834d67e2018-05-26 13:58:03 +020043 titan.ProtocolModules.ROSE \
Harald Welte68079822017-12-12 16:30:53 +010044 titan.ProtocolModules.SCTP \
45 titan.ProtocolModules.SUA \
46 titan.ProtocolModules.SDP \
47 titan.TestPorts.GPIO \
48 titan.ProtocolModules.BSSAPP_v7.3.0 \
49 titan.ProtocolModules.BSSGP_v13.0.0 \
Harald Welte68079822017-12-12 16:30:53 +010050 titan.ProtocolModules.GTP_v13.5.0 \
51 titan.ProtocolModules.GTPv2_v13.7.0 \
52 titan.ProtocolModules.ISUP_Q.762 \
Harald Welte68079822017-12-12 16:30:53 +010053 titan.ProtocolModules.MobileL3_v13.4.0 \
54 titan.ProtocolModules.NS_v7.3.0 \
Harald Welteb1add592018-03-27 20:43:40 +020055 titan.ProtocolModules.SNDCP_v7.0.0 \
56 titan.ProtocolEmulations.SCCP
Harald Welte68079822017-12-12 16:30:53 +010057
Harald Welte6fc784e2018-02-25 23:31:37 +010058OSMOGITHUB_REPOS= titan.TestPorts.SCTPasp \
Harald Welte2216b752019-04-23 22:13:51 +020059 titan.ProtocolModules.LLC_v7.1.0 \
Harald Welte1fd461a2018-10-28 10:26:13 +010060 titan.ProtocolModules.SGsAP_13.2.0 \
Harald Weltec87abfc2018-03-18 10:58:00 +010061 titan.TestPorts.MTP3asp \
Harald Welteb1add592018-03-27 20:43:40 +020062 titan.ProtocolEmulations.M3UA
Harald Welte701b5742018-01-22 11:29:13 +010063
Pau Espin Pedrolfe0c6082019-05-20 19:20:55 +020064OSMOGIT_REPOS= titan.ProtocolModules.MAP \
65 titan.ProtocolModules.BSSMAP
Harald Welte3103fce2018-05-26 13:58:31 +020066
67ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS) $(OSMOGIT_REPOS)
Harald Welte68079822017-12-12 16:30:53 +010068
Stefan Sperling61c11e92018-03-20 18:25:26 +010069# Tag names from 'git-describe --tags'; if not available, a commit hash may be used instead.
70# In order to keep local changes in the repository of a dependency, set its commit to the
71# name of a local branch here (e.g. 'master').
Stefan Sperling61c11e92018-03-20 18:25:26 +010072titan.Libraries.TCCUsefulFunctions_commit= R.30.A
Stefan Sperlinge6bf4ac2018-06-12 17:36:26 +020073titan.ProtocolEmulations.M3UA_commit= R.2.A-2-g742cf02
Harald Welteb1add592018-03-27 20:43:40 +020074titan.ProtocolEmulations.SCCP_commit= R.7.A-2-g724c83f
Stefan Sperling61c11e92018-03-20 18:25:26 +010075titan.ProtocolModules.BSSAPP_v7.3.0_commit= R.2.A
76titan.ProtocolModules.BSSGP_v13.0.0_commit= R.2.A
Pau Espin Pedrolfe0c6082019-05-20 19:20:55 +020077titan.ProtocolModules.BSSMAP_commit= master
Stefan Sperling61c11e92018-03-20 18:25:26 +010078titan.ProtocolModules.GRE_commit= R.2.A
79titan.ProtocolModules.GTP_v13.5.0_commit= R.2.A
80titan.ProtocolModules.GTPv2_v13.7.0_commit= R.2.A
81titan.ProtocolModules.ICMP_commit= R.2.A
82titan.ProtocolModules.ICMPv6_commit= R.2.A
83titan.ProtocolModules.IP_commit= R.10.B-1-g99d0ec9
84titan.ProtocolModules.ISUP_Q.762_commit= R.8.A
85titan.ProtocolModules.L2TP_commit= R.2.A
Harald Welte2216b752019-04-23 22:13:51 +020086titan.ProtocolModules.LLC_v7.1.0_commit= 2a3c09fbf7bae22f802aa88689800f38a1f3732d
Harald Welte3103fce2018-05-26 13:58:31 +020087titan.ProtocolModules.MAP_commit= R.2.A-1-g79c6a3d
Stefan Sperling61c11e92018-03-20 18:25:26 +010088titan.ProtocolModules.M2PA_commit= R.2.A
89titan.ProtocolModules.M3UA_commit= R.2.A
90titan.ProtocolModules.MobileL3_v13.4.0_commit= R.2.A
91titan.ProtocolModules.NS_v7.3.0_commit= R.2.A
92titan.ProtocolModules.RTP_commit= R.5.A
Harald Welte834d67e2018-05-26 13:58:03 +020093titan.ProtocolModules.ROSE_commit= R.1.C
Stefan Sperling61c11e92018-03-20 18:25:26 +010094titan.ProtocolModules.SCTP_commit= R.2.A
Harald Welte1fd461a2018-10-28 10:26:13 +010095titan.ProtocolModules.SGsAP_13.2.0_commit= 520dc48dd41ee15c9fd77e71d2ea7a05c58770b9
Stefan Sperling61c11e92018-03-20 18:25:26 +010096titan.ProtocolModules.SDP_commit= R.14.A
Harald Welte36296dc2018-04-16 17:37:31 +020097titan.ProtocolModules.SMPP_commit= R.2.A-2-gb7aee69
Stefan Sperling61c11e92018-03-20 18:25:26 +010098titan.ProtocolModules.SNDCP_v7.0.0_commit= R.2.A
99titan.ProtocolModules.SUA_commit= R.5.A
100titan.ProtocolModules.TCP_commit= R.3.A
101titan.ProtocolModules.UDP_commit= R.4.A
102titan.TestPorts.Common_Components.Socket-API_commit= R.6.A
103titan.TestPorts.GPIO_commit= R.3.A
104titan.TestPorts.IPL4asp_commit= R.29.A
105titan.TestPorts.LANL2asp_commit= R.8.B
106titan.TestPorts.MTP3asp_commit= 1cecdad6f3641a5f19b3833703bff6e5005eff11
107titan.TestPorts.PCAPasp_commit= R.7.A
108titan.TestPorts.SCTPasp_commit= R.11.A-2-g2faa9cf
109titan.TestPorts.SIPmsg_commit= R.15.A-1-ge4f9dd0
110titan.TestPorts.TCPasp_commit= R.9.A
111titan.TestPorts.TELNETasp_commit= R.9.A
112titan.TestPorts.UDPasp_commit= R.8.A
Harald Welte0a068c32018-04-06 13:52:35 +0200113titan.TestPorts.UNIX_DOMAIN_SOCKETasp_commit= R.2.A-4-gbacd73d
Harald Welte68079822017-12-12 16:30:53 +0100114
Stefan Sperling61c11e92018-03-20 18:25:26 +0100115all: $(foreach dir,$(ALL_REPOS),$(dir)/update)
Harald Welte68079822017-12-12 16:30:53 +0100116clean: $(foreach dir,$(ALL_REPOS),$(dir)/clean)
Stefan Sperlinga2b54492018-03-22 10:22:25 +0100117distclean: $(foreach dir,$(ALL_REPOS),$(dir)/distclean)
Harald Welte68079822017-12-12 16:30:53 +0100118
119define GIT_template
Stefan Sperling61c11e92018-03-20 18:25:26 +0100120$(1)_ORIGIN!= if [ -d $(1) ]; then cd $(1) && git remote get-url origin; fi
121$(1)_HEAD!= if [ -d $(1) ]; then cd $(1) && git describe --tags 2>/dev/null || git rev-parse HEAD; fi
Stefan Sperlinga2b54492018-03-22 10:22:25 +0100122$(1)_MODIFIED!= if [ -d $(1) ]; then cd $(1) && git diff --quiet --exit-code || echo -n "1"; fi
Stefan Sperling61c11e92018-03-20 18:25:26 +0100123
Harald Welte68079822017-12-12 16:30:53 +0100124$(1):
125 git clone $(2)/$(1)
126
Stefan Sperling61c11e92018-03-20 18:25:26 +0100127.PHONY: $(1)/update
Harald Welte68079822017-12-12 16:30:53 +0100128$(1)/update: $(1)
Stefan Sperlinga2b54492018-03-22 10:22:25 +0100129ifeq ($$($(1)_MODIFIED),1)
130 @echo "WARNING: $(1) skipped because it contains uncommitted modifications!"
131else
Stefan Sperling61c11e92018-03-20 18:25:26 +0100132ifneq ($$($(1)_ORIGIN),$(2)/$(1))
133 cd $(1) && git remote set-url origin $(2)/$(1) && git fetch
134endif
135ifneq ($$($(1)_HEAD),$($(1)_commit))
Harald Welte035f7f82018-03-27 20:49:27 +0200136 cd $(1) && git fetch && git checkout -q -f "$($(1)_commit)"
Stefan Sperling61c11e92018-03-20 18:25:26 +0100137endif
Stefan Sperlinga2b54492018-03-22 10:22:25 +0100138endif
Harald Welte68079822017-12-12 16:30:53 +0100139
140.PHONY: $(1)/clean
Harald Welte4c294b62018-02-15 18:27:10 +0100141$(1)/clean: $(1)
Stefan Sperlinga2b54492018-03-22 10:22:25 +0100142ifeq ($$($(1)_MODIFIED),1)
143 @echo "WARNING: $(1) skipped because it contains uncommitted modifications!"
144else
Harald Welte035f7f82018-03-27 20:49:27 +0200145 cd $(1) && git fetch && git checkout -q -f "$($(1)_commit)" && git reset --hard
Stefan Sperlinga2b54492018-03-22 10:22:25 +0100146endif
Harald Welte4c294b62018-02-15 18:27:10 +0100147
148.PHONY: $(1)/distclean
149$(1)/distclean:
Stefan Sperlinga2b54492018-03-22 10:22:25 +0100150ifeq ($$($(1)_MODIFIED),1)
151 @echo "WARNING: $(1) skipped because it contains uncommitted modifications!"
152else
Harald Welte68079822017-12-12 16:30:53 +0100153 @rm -rf $(1)
Stefan Sperlinga2b54492018-03-22 10:22:25 +0100154endif
Harald Welte68079822017-12-12 16:30:53 +0100155endef
156
157$(foreach dir,$(ECLIPSEGIT_REPOS), \
158 $(eval $(call GIT_template,$(dir),$(ECLIPSEGIT))))
159
160$(foreach dir,$(ECLIPSEGIT2_REPOS), \
161 $(eval $(call GIT_template,$(dir),$(ECLIPSEGIT2))))
Harald Welte701b5742018-01-22 11:29:13 +0100162
163$(foreach dir,$(OSMOGITHUB_REPOS), \
164 $(eval $(call GIT_template,$(dir),$(OSMOGITHUB))))
Harald Welte3103fce2018-05-26 13:58:31 +0200165
166$(foreach dir,$(OSMOGIT_REPOS), \
167 $(eval $(call GIT_template,$(dir),$(OSMOGIT))))