]> git.argeo.org Git - gpl/argeo-tp.git/blobdiff - bootstrap/Makefile
Improve bootstrap build
[gpl/argeo-tp.git] / bootstrap / Makefile
index 12514c64d6c36b1666a19b22119a2d8f4309bafd..99b2d02dd6a340b23bd2ed12c469625e04d0e280 100644 (file)
@@ -1,5 +1,4 @@
-include ../sdk.mk
-include ../common.mk
+-include sdk.mk
 
 ECJ_VERSION=4.26
 
@@ -10,6 +9,7 @@ OSGI_ANNOTATION_VERSION=7.0.0
 SLF4J_VERSION=1.7.36
 
 ORIGIN_BASE=$(HOME)/.cache/argeo/build/origin
+SDK_BUILD_BASE ?= ./output
 BOOTSTRAP_BASE=$(SDK_BUILD_BASE)/bootstrap
 
 ECJ_BASE=./ecj
@@ -31,20 +31,14 @@ $(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)/org | grep "\.java" > $(BOOTSTRAP_BASE)/ecj.todo
-       # copy sources
-       mkdir -p $(ECJ_SRC)
-       cp -r $(ECJ_BASE)/org $(ECJ_SRC)
+       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
-       # remove sources
-       cd $(ECJ_BASE) && find . -name "*.java" -name "*.html" -type f -exec rm -f {} \;
        
-bndlib-build:
+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) \
@@ -52,11 +46,20 @@ bndlib-build:
 
 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
+
+distclean:
+       rm -f sdk.mk
+       rm -rf ./output
+
+clean-sources:
        $(RM) -rf $(ECJ_BASE)
        $(RM) -rf $(BNDLIB_BASE)
-       make -C org.argeo.tp.build clean
+       rm -rf org.argeo.tp.build/biz.aQute.bndlib/src
 
-bootstrap-prepare-source-tarball: bootstrap-download-sources
+bootstrap-prepare-sources: bootstrap-download-sources
        ## ECJ
        mkdir -p $(ECJ_BASE)
        cd $(ECJ_BASE) && jar -xf $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar
@@ -69,6 +72,13 @@ bootstrap-prepare-source-tarball: bootstrap-download-sources
        $(RM) -rf $(ECJ_BASE)/scripts
        # TODO: keep the service files
        $(RM) -rf  $(ECJ_BASE)/META-INF
+
+       # copy sources and resources
+       mkdir -p $(ECJ_SRC)
+       cp -r $(ECJ_BASE)/org $(ECJ_SRC)
+       # 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
        # copy sources
@@ -104,10 +114,12 @@ bootstrap-prepare-source-tarball: bootstrap-download-sources
        # clean up BNDLIB
        $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/annotation/spi
        $(RM) -rf $(BNDLIB_SRC)/aQute/bnd/junit
-               
-       tar -cf ../argeo-tp-build_$(ECJ_VERSION).orig.tar $(ECJ_BASE)
-       tar -rf ../argeo-tp-build_$(ECJ_VERSION).orig.tar $(BNDLIB_BASE)
-       xz -f ../argeo-tp-build_$(ECJ_VERSION).orig.tar
+
+       mkdir -p org.argeo.tp.build/biz.aQute.bndlib/src
+       cp -r ../rebuild/org.argeo.tp/org.argeo.ext.slf4j/src/* org.argeo.tp.build/biz.aQute.bndlib/src
+       
+       # make sure directory is clean
+       $(RM) -rf ./output
 
 bootstrap-download-sources: $(SOURCE_ARCHIVES)