]> git.argeo.org Git - gpl/argeo-tp.git/blob - bootstrap/Makefile
Working debuild for bootstrap
[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 BOOTSTRAP_BASE=$(SDK_BUILD_BASE)/bootstrap
13
14 ECJ_BASE=./ecj
15 ECJ_SRC=$(ECJ_BASE)/OSGI-OPT/src
16
17 BNDLIB_BASE=./bndlib
18 BNDLIB_SRC=$(BNDLIB_BASE)/OSGI-OPT/src
19
20 OSGI_BASE=$(BOOTSTRAP_BASE)/osgi
21
22 SOURCE_ARCHIVES=\
23 $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar \
24 $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar \
25 $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar \
26 $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar \
27 $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar \
28 $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz
29
30 all: ecj-build bndlib-build
31 make -C org.argeo.tp.build all
32
33 ecj-build:
34 mkdir -p $(BOOTSTRAP_BASE)
35 # list sources
36 find $(ECJ_BASE)/OSGI-OPT/src | grep "\.java" > $(BOOTSTRAP_BASE)/ecj.todo
37 # build
38 $(JAVA_HOME)/bin/javac -d $(ECJ_BASE) -source 17 -target 17 -Xlint:none @$(BOOTSTRAP_BASE)/ecj.todo
39
40 bndlib-build: ecj-build
41 $(JAVA_HOME)/bin/java -cp $(ECJ_BASE) org.eclipse.jdt.internal.compiler.batch.Main -nowarn \
42 -source 17 -target 17 \
43 $(BNDLIB_SRC) \
44 -d $(BNDLIB_BASE)
45
46 clean:
47 $(RM) -rf $(BOOTSTRAP_BASE)
48 find $(ECJ_BASE) -name "*.class" -type f -exec rm -f {} \;
49 find $(BNDLIB_BASE) -name "*.class" -type f -exec rm -f {} \;
50 make -C org.argeo.tp.build clean
51
52 clean-sources:
53 $(RM) -rf $(ECJ_BASE)
54 $(RM) -rf $(BNDLIB_BASE)
55
56 bootstrap-prepare-sources: bootstrap-download-sources
57 ## ECJ
58 mkdir -p $(ECJ_BASE)
59 cd $(ECJ_BASE) && jar -xf $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar
60 # remove ant-dependent class
61 $(RM) $(ECJ_BASE)/org/eclipse/jdt/core/JDTCompilerAdapter.java
62 # clean up
63 $(RM) $(ECJ_BASE)/*.jar
64 $(RM) $(ECJ_BASE)/build.xml
65 $(RM) $(ECJ_BASE)/ecj.1
66 $(RM) -rf $(ECJ_BASE)/scripts
67 # TODO: keep the service files
68 $(RM) -rf $(ECJ_BASE)/META-INF
69
70 # copy sources and resources
71 mkdir -p $(ECJ_SRC)
72 cp -r $(ECJ_BASE)/org $(ECJ_SRC)
73 # remove java sources
74 cd $(ECJ_BASE) && find org -name "*.java" -type f -exec rm -f {} \;
75 cd $(ECJ_BASE) && find org -name "*.html" -type f -exec rm -f {} \;
76
77 ## BNDLIB
78 # copy sources
79 mkdir -p $(BOOTSTRAP_BASE)
80 cd $(BOOTSTRAP_BASE) && tar -xzf $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz
81 mkdir -p $(BNDLIB_SRC)
82 cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/aQute.libg/src/* $(BNDLIB_SRC)
83 cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/biz.aQute.bndlib/src/* $(BNDLIB_SRC)
84 cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/biz.aQute.bnd.annotation/src/* $(BNDLIB_SRC)
85 $(RM) -rf $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL
86
87 # OSGi
88 mkdir -p $(OSGI_BASE)
89 cd $(OSGI_BASE) && jar -xf $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar
90 cd $(OSGI_BASE) && jar -xf $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar
91 cd $(OSGI_BASE) && jar -xf $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar
92
93 mkdir -p $(BNDLIB_SRC)/org/osgi/service
94 cp -r $(OSGI_BASE)/org/osgi/annotation $(BNDLIB_SRC)/org/osgi
95 cp -r $(OSGI_BASE)/org/osgi/resource $(BNDLIB_SRC)/org/osgi
96 cp -r $(OSGI_BASE)/org/osgi/framework $(BNDLIB_SRC)/org/osgi
97 cp -r $(OSGI_BASE)/org/osgi/namespace $(BNDLIB_SRC)/org/osgi
98 cp -r $(OSGI_BASE)/org/osgi/util $(BNDLIB_SRC)/org/osgi
99 cp -r $(OSGI_BASE)/org/osgi/dto $(BNDLIB_SRC)/org/osgi
100 cp -r $(OSGI_BASE)/org/osgi/service/repository $(BNDLIB_SRC)/org/osgi/service
101 cp -r $(OSGI_BASE)/org/osgi/service/log $(BNDLIB_SRC)/org/osgi/service
102
103 # SLF4J
104 cd $(BNDLIB_SRC) && jar -xf $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar
105 $(RM) -rf $(BNDLIB_SRC)/META-INF
106 cp -rv ../rebuild/org.argeo.tp/org.argeo.ext.slf4j/src/* $(BNDLIB_SRC)
107
108 # clean up BNDLIB
109 $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/annotation/spi
110 $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/junit
111
112 bootstrap-download-sources: $(SOURCE_ARCHIVES)
113
114 $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar:
115 mkdir -p $(ORIGIN_BASE)
116 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
117
118 $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz:
119 mkdir -p $(ORIGIN_BASE)
120 wget -c -O $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz https://github.com/bndtools/bnd/archive/refs/tags/$(BND_VERSION).REL.tar.gz
121
122 $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar:
123 mkdir -p $(ORIGIN_BASE)/org.osgi
124 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
125
126 $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar:
127 mkdir -p $(ORIGIN_BASE)/org.osgi
128 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
129
130 $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar:
131 mkdir -p $(ORIGIN_BASE)/org.osgi
132 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
133
134 $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar:
135 mkdir -p $(ORIGIN_BASE)/org.slf4j
136 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
137
138
139