]> git.argeo.org Git - gpl/argeo-tp.git/blob - bootstrap/Makefile
Use our own versions
[gpl/argeo-tp.git] / bootstrap / Makefile
1 -include sdk.mk
2
3 ECJ_VERSION=4.26
4
5 BND_VERSION=5.3.0
6 OSGI_CORE_VERSION=7.0.0
7 OSGI_CMPN_VERSION=7.0.0
8 OSGI_ANNOTATION_VERSION=7.0.0
9 SLF4J_VERSION=1.7.36
10
11 ORIGIN_BASE=$(HOME)/.cache/argeo/build/origin
12 SDK_BUILD_BASE ?= ./output
13 BOOTSTRAP_BASE=$(SDK_BUILD_BASE)/bootstrap
14
15 ECJ_BASE=./ecj
16 ECJ_SRC=$(ECJ_BASE)/OSGI-OPT/src
17
18 BNDLIB_BASE=./bndlib
19 BNDLIB_SRC=$(BNDLIB_BASE)/OSGI-OPT/src
20
21 OSGI_BASE=$(BOOTSTRAP_BASE)/osgi
22
23 SOURCE_ARCHIVES=\
24 $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar \
25 $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar \
26 $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar \
27 $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar \
28 $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar \
29 $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz
30
31 all: ecj-build bndlib-build
32 make -C org.argeo.tp.build all
33
34 ecj-build:
35 mkdir -p $(BOOTSTRAP_BASE)
36 # list sources
37 find $(ECJ_BASE)/OSGI-OPT/src | grep "\.java" > $(BOOTSTRAP_BASE)/ecj.todo
38 # build
39 $(JAVA_HOME)/bin/javac -d $(ECJ_BASE) -source 17 -target 17 -Xlint:none @$(BOOTSTRAP_BASE)/ecj.todo
40
41 bndlib-build: ecj-build
42 $(JAVA_HOME)/bin/java -cp $(ECJ_BASE) org.eclipse.jdt.internal.compiler.batch.Main -nowarn \
43 -source 17 -target 17 \
44 $(BNDLIB_SRC) \
45 -d $(BNDLIB_BASE)
46
47 clean:
48 $(RM) -rf $(BOOTSTRAP_BASE)
49 find $(ECJ_BASE) -name "*.class" -type f -exec rm -f {} \;
50 find $(BNDLIB_BASE) -name "*.class" -type f -exec rm -f {} \;
51 make -C org.argeo.tp.build clean
52
53 distclean:
54 $(RM) -f sdk.mk
55 $(RM) -rf ./output
56
57 clean-sources:
58 $(RM) -rf $(ECJ_BASE)
59 $(RM) -rf $(BNDLIB_BASE)
60 $(RM) -rf org.argeo.tp.build/biz.aQute.bndlib/src
61
62 deb-source: distclean clean-sources bootstrap-prepare-sources
63 debuild --no-sign -S
64 $(RM) -f debian/files
65 $(RM) -rf $(ECJ_BASE)
66 $(RM) -rf $(BNDLIB_BASE)
67 $(RM) -rf org.argeo.tp.build/biz.aQute.bndlib/src
68
69 bootstrap-prepare-sources: bootstrap-download-sources
70 ## ECJ
71 mkdir -p $(ECJ_BASE)
72 cd $(ECJ_BASE) && jar -xf $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar
73 # remove ant-dependent class
74 $(RM) $(ECJ_BASE)/org/eclipse/jdt/core/JDTCompilerAdapter.java
75 # clean up
76 $(RM) $(ECJ_BASE)/*.jar
77 $(RM) $(ECJ_BASE)/build.xml
78 $(RM) $(ECJ_BASE)/ecj.1
79 $(RM) -rf $(ECJ_BASE)/scripts
80 # TODO: keep the service files
81 $(RM) -rf $(ECJ_BASE)/META-INF
82
83 # copy sources and resources
84 mkdir -p $(ECJ_SRC)
85 cp -r $(ECJ_BASE)/org $(ECJ_SRC)
86 # remove java sources
87 cd $(ECJ_BASE) && find org -name "*.java" -type f -exec rm -f {} \;
88 cd $(ECJ_BASE) && find org -name "*.html" -type f -exec rm -f {} \;
89
90 ## BNDLIB
91 # copy sources
92 mkdir -p $(BOOTSTRAP_BASE)
93 cd $(BOOTSTRAP_BASE) && tar -xzf $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz
94 mkdir -p $(BNDLIB_SRC)
95 cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/aQute.libg/src/* $(BNDLIB_SRC)
96 cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/biz.aQute.bndlib/src/* $(BNDLIB_SRC)
97 cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/biz.aQute.bnd.annotation/src/* $(BNDLIB_SRC)
98 $(RM) -rf $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL
99
100 # OSGi
101 mkdir -p $(OSGI_BASE)
102 cd $(OSGI_BASE) && jar -xf $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar
103 cd $(OSGI_BASE) && jar -xf $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar
104 cd $(OSGI_BASE) && jar -xf $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar
105
106 mkdir -p $(BNDLIB_SRC)/org/osgi/service
107 cp -r $(OSGI_BASE)/org/osgi/annotation $(BNDLIB_SRC)/org/osgi
108 cp -r $(OSGI_BASE)/org/osgi/resource $(BNDLIB_SRC)/org/osgi
109 cp -r $(OSGI_BASE)/org/osgi/framework $(BNDLIB_SRC)/org/osgi
110 cp -r $(OSGI_BASE)/org/osgi/namespace $(BNDLIB_SRC)/org/osgi
111 cp -r $(OSGI_BASE)/org/osgi/util $(BNDLIB_SRC)/org/osgi
112 cp -r $(OSGI_BASE)/org/osgi/dto $(BNDLIB_SRC)/org/osgi
113 cp -r $(OSGI_BASE)/org/osgi/service/repository $(BNDLIB_SRC)/org/osgi/service
114 cp -r $(OSGI_BASE)/org/osgi/service/log $(BNDLIB_SRC)/org/osgi/service
115
116 # SLF4J
117 cd $(BNDLIB_SRC) && jar -xf $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar
118 $(RM) -rf $(BNDLIB_SRC)/META-INF
119 cp -rv ../rebuild/org.argeo.tp/org.argeo.ext.slf4j/src/* $(BNDLIB_SRC)
120
121 # clean up BNDLIB
122 $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/annotation/spi
123 $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/junit
124
125 #mkdir -p org.argeo.tp.build/biz.aQute.bndlib/src
126 #cp -r ../rebuild/org.argeo.tp/org.argeo.ext.slf4j/src/* org.argeo.tp.build/biz.aQute.bndlib/src
127
128 # make sure directory is clean
129 $(RM) -rf ./output
130
131 bootstrap-download-sources: $(SOURCE_ARCHIVES)
132
133 $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar:
134 mkdir -p $(ORIGIN_BASE)
135 wget -c -O $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar https://ftp-stud.hs-esslingen.de/Mirrors/eclipse/eclipse/downloads/drops4/R-4.26-202211231800/ecjsrc-$(ECJ_VERSION).jar
136
137 $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz:
138 mkdir -p $(ORIGIN_BASE)
139 wget -c -O $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz https://github.com/bndtools/bnd/archive/refs/tags/$(BND_VERSION).REL.tar.gz
140
141 $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar:
142 mkdir -p $(ORIGIN_BASE)/org.osgi
143 wget -c -O $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar https://repo1.maven.org/maven2/org/osgi/osgi.core/$(OSGI_CORE_VERSION)/osgi.core-$(OSGI_CORE_VERSION)-sources.jar
144
145 $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar:
146 mkdir -p $(ORIGIN_BASE)/org.osgi
147 wget -c -O $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar https://repo1.maven.org/maven2/org/osgi/osgi.cmpn/$(OSGI_CMPN_VERSION)/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar
148
149 $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar:
150 mkdir -p $(ORIGIN_BASE)/org.osgi
151 wget -c -O $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar https://repo1.maven.org/maven2/org/osgi/osgi.annotation/$(OSGI_ANNOTATION_VERSION)/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar
152
153 $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar:
154 mkdir -p $(ORIGIN_BASE)/org.slf4j
155 wget -c -O $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar https://repo1.maven.org/maven2/org/slf4j/slf4j-api/$(SLF4J_VERSION)/slf4j-api-$(SLF4J_VERSION)-sources.jar
156
157
158