X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=bootstrap%2FMakefile;h=cdae8df4ed93fb158cbf534949be29680ae313fa;hb=afd7fd6484e95660ae5d285e11d6520b18a05a00;hp=c05663602bc8bffcb2be17ee23b30a0ea0efcdf7;hpb=0301f5aa84ea0661efa22f83a5f94eac62eac7b9;p=gpl%2Fargeo-tp.git diff --git a/bootstrap/Makefile b/bootstrap/Makefile index c056636..cdae8df 100644 --- a/bootstrap/Makefile +++ b/bootstrap/Makefile @@ -1,34 +1,60 @@ -include ../sdk.mk -include ../common.mk +-include sdk.mk ECJ_VERSION=4.26 + BND_VERSION=5.3.0 +OSGI_CORE_VERSION=7.0.0 +OSGI_CMPN_VERSION=7.0.0 +OSGI_ANNOTATION_VERSION=7.0.0 +SLF4J_VERSION=1.7.36 ORIGIN_BASE=$(HOME)/.cache/argeo/build/origin BOOTSTRAP_BASE=$(SDK_BUILD_BASE)/bootstrap -ECJ_BASE=$(BOOTSTRAP_BASE)/ecj +ECJ_BASE=./ecj ECJ_SRC=$(ECJ_BASE)/OSGI-OPT/src -BNDLIB_BASE=$(BOOTSTRAP_BASE)/bndlib +BNDLIB_BASE=./bndlib BNDLIB_SRC=$(BNDLIB_BASE)/OSGI-OPT/src -bootstrap-download-sources: $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz - -$(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar: - mkdir -p $(ORIGIN_BASE) - 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 - -$(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz: - mkdir -p $(ORIGIN_BASE) - wget -c -O $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz https://github.com/bndtools/bnd/archive/refs/tags/$(BND_VERSION).REL.tar.gz +OSGI_BASE=$(BOOTSTRAP_BASE)/osgi + +SOURCE_ARCHIVES=\ +$(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar \ +$(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar \ +$(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar \ +$(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar \ +$(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar \ +$(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz all: ecj-build bndlib-build make -C org.argeo.tp.build all -ecj: ecj-build - ecj-build: + mkdir -p $(BOOTSTRAP_BASE) + # list sources + find $(ECJ_BASE)/OSGI-OPT/src | grep "\.java" > $(BOOTSTRAP_BASE)/ecj.todo + # build + $(JAVA_HOME)/bin/javac -d $(ECJ_BASE) -source 17 -target 17 -Xlint:none @$(BOOTSTRAP_BASE)/ecj.todo + +bndlib-build: ecj-build + $(JAVA_HOME)/bin/java -cp $(ECJ_BASE) org.eclipse.jdt.internal.compiler.batch.Main -nowarn \ + -source 17 -target 17 \ + $(BNDLIB_SRC) \ + -d $(BNDLIB_BASE) + +clean: + $(RM) -rf $(BOOTSTRAP_BASE) + find $(ECJ_BASE) -name "*.class" -type f -exec rm -f {} \; + find $(BNDLIB_BASE) -name "*.class" -type f -exec rm -f {} \; + make -C org.argeo.tp.build clean + +clean-sources: + $(RM) -rf $(ECJ_BASE) + $(RM) -rf $(BNDLIB_BASE) + +bootstrap-prepare-sources: bootstrap-download-sources + ## ECJ mkdir -p $(ECJ_BASE) cd $(ECJ_BASE) && jar -xf $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar # remove ant-dependent class @@ -40,36 +66,74 @@ ecj-build: $(RM) -rf $(ECJ_BASE)/scripts # TODO: keep the service files $(RM) -rf $(ECJ_BASE)/META-INF - # list sources - find $(ECJ_BASE)/org | grep "\.java" > $(BOOTSTRAP_BASE)/ecj.todo - # copy sources + + # copy sources and resources mkdir -p $(ECJ_SRC) cp -r $(ECJ_BASE)/org $(ECJ_SRC) - # build - $(JAVA_HOME)/bin/javac -d $(ECJ_BASE) -source 17 -target 17 -Xlint:none @$(BOOTSTRAP_BASE)/ecj.todo - # remove sources - cd $(ECJ_BASE) && find . -name "*.java" -name "*.html" -type f -exec rm -f {} \; + # remove java sources + cd $(ECJ_BASE) && find org -name "*.java" -type f -exec rm -f {} \; + cd $(ECJ_BASE) && find org -name "*.html" -type f -exec rm -f {} \; -bndlib-build: ecj-build + ## BNDLIB # copy sources + mkdir -p $(BOOTSTRAP_BASE) cd $(BOOTSTRAP_BASE) && tar -xzf $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz mkdir -p $(BNDLIB_SRC) cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/aQute.libg/src/* $(BNDLIB_SRC) cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/biz.aQute.bndlib/src/* $(BNDLIB_SRC) cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/biz.aQute.bnd.annotation/src/* $(BNDLIB_SRC) - rm -rf $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL - - # clean up - rm -rf $(BNDLIB_SRC)/aQute/bnd/junit + $(RM) -rf $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL + + # OSGi + mkdir -p $(OSGI_BASE) + cd $(OSGI_BASE) && jar -xf $(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar + cd $(OSGI_BASE) && jar -xf $(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar + cd $(OSGI_BASE) && jar -xf $(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar - # build - $(JAVA_HOME)/bin/java -cp $(ECJ_BASE) org.eclipse.jdt.internal.compiler.batch.Main -nowarn \ - -cp $(BND_CLASSPATH) \ - -source 17 -target 17 \ - $(BNDLIB_SRC) \ - -d $(BNDLIB_BASE) + mkdir -p $(BNDLIB_SRC)/org/osgi/service + cp -r $(OSGI_BASE)/org/osgi/annotation $(BNDLIB_SRC)/org/osgi + cp -r $(OSGI_BASE)/org/osgi/resource $(BNDLIB_SRC)/org/osgi + cp -r $(OSGI_BASE)/org/osgi/framework $(BNDLIB_SRC)/org/osgi + cp -r $(OSGI_BASE)/org/osgi/namespace $(BNDLIB_SRC)/org/osgi + cp -r $(OSGI_BASE)/org/osgi/util $(BNDLIB_SRC)/org/osgi + cp -r $(OSGI_BASE)/org/osgi/dto $(BNDLIB_SRC)/org/osgi + cp -r $(OSGI_BASE)/org/osgi/service/repository $(BNDLIB_SRC)/org/osgi/service + cp -r $(OSGI_BASE)/org/osgi/service/log $(BNDLIB_SRC)/org/osgi/service + + # SLF4J + cd $(BNDLIB_SRC) && jar -xf $(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar + $(RM) -rf $(BNDLIB_SRC)/META-INF + cp -rv ../rebuild/org.argeo.tp/org.argeo.ext.slf4j/src/* $(BNDLIB_SRC) + + # clean up BNDLIB + $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/annotation/spi + $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/junit + +bootstrap-download-sources: $(SOURCE_ARCHIVES) + +$(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar: + mkdir -p $(ORIGIN_BASE) + 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 +$(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz: + mkdir -p $(ORIGIN_BASE) + wget -c -O $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz https://github.com/bndtools/bnd/archive/refs/tags/$(BND_VERSION).REL.tar.gz -clean: - rm -rf $(BOOTSTRAP_BASE) - make -C org.argeo.tp.build clean +$(ORIGIN_BASE)/org.osgi/osgi.core-$(OSGI_CORE_VERSION)-sources.jar: + mkdir -p $(ORIGIN_BASE)/org.osgi + 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 + +$(ORIGIN_BASE)/org.osgi/osgi.cmpn-$(OSGI_CMPN_VERSION)-sources.jar: + mkdir -p $(ORIGIN_BASE)/org.osgi + 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 + +$(ORIGIN_BASE)/org.osgi/osgi.annotation-$(OSGI_ANNOTATION_VERSION)-sources.jar: + mkdir -p $(ORIGIN_BASE)/org.osgi + 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 + +$(ORIGIN_BASE)/org.slf4j/slf4j-api-$(SLF4J_VERSION)-sources.jar: + mkdir -p $(ORIGIN_BASE)/org.slf4j + 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 + + +