]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Starting to make mailleur an autonomous git
authorJean-Marc Pigeon <jmp@safe.c>
Fri, 19 Dec 2025 21:15:27 +0000 (16:15 -0500)
committerJean-Marc Pigeon <jmp@safe.c>
Fri, 19 Dec 2025 21:15:27 +0000 (16:15 -0500)
Makefile
Makefile.git [new file with mode: 0644]
lib/subrou.d.29728 [new file with mode: 0644]

index 24823ba839db2e31087d5df720b1f2d2e086c8fd..317b209306d327d680ab9baab3b9b278be460094 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,8 @@
 #default make
 default        :  clean prod
 #--------------------------------------------------------------------
+#Makefile with all data for GIT
+include Makefile.git
 #test area Makefile
 include        Makefile.dbg
 #distribution area Makefile
diff --git a/Makefile.git b/Makefile.git
new file mode 100644 (file)
index 0000000..2e8a686
--- /dev/null
@@ -0,0 +1,67 @@
+#--------------------------------------------------------------------
+#to prepare git function
+#version change
+CURTAG =       $(shell git rev-parse --abbrev-ref HEAD)
+BRANCH =       $(shell echo $(CURTAG) | cut -d '-' -f3)
+RELEASE        =       $(shell git rev-list --count $(CURTAG) ^tag-$(VERSION))
+VERSION        =       $(shell echo $(CURTAG) | cut -d'-' -f2)
+NEXTREL        =       $(shell echo $(RELEASE) + 1 |bc)
+MAILREL        =       $(shell echo $(VERSION)-$(NEXTREL)-$(BRANCH))
+#--------------------------------------------------------------------
+github :  
+          @ (cd pub-mailleur ; git push --tags $@ $(BR):$(BR))
+
+allcom :  commit maincom
+
+maincom        :  clean
+          @ git add . mailleur
+          @ git commit -a
+          @ $(MAKE) -s push
+
+push   :
+           git push --tags origin $$BR:$$BR ;  
+
+commit :  fclean dovers
+          @ (                                                  \
+               cd $(PUB) ;                                     \
+               git add . ;                                     \
+               git commit -a ;                                 \
+               git push --tags origin $$BR:$$BR ;              \
+            )
+
+BR     =  $(shell git branch | sed -e '/^[^*]/d' -e 's/* //')
+#--------------------------------------------------------------------
+gitcheck:
+          @ echo CURTAG=$(CURTAG)
+          @ echo BRANCH=$(BRANCH)
+          @ echo VERSION=$(VERSION)
+          @ echo RELEASE=$(RELEASE)
+
+#--------------------------------------------------------------------
+#to clean directory before a git commit
+fclean :  clean
+          @ rm -fr core.*
+          @ rm -fr srcrpm/*
+
+#prepare version and working dirs
+dovers :  
+           @ make -s clean
+           @ echo "Updating Version WITH $(BRANCH)"
+           @ (                                                 \
+             echo -e "#define VERSION\t\"$(VERSION)\"";        \
+             echo -e "#define RELEASE\t\"$(NEXTREL)\"";        \
+             echo -e "#define BRANCH\t\"$(BRANCH)\"";          \
+             ) > ./lib/numver.h
+            (                                                  \
+             sed                                               \
+              -e "s/=VERSION/=\"$(VERSION)\"/"                 \
+              -e "s/=NEXTREL/=\"$(NEXTREL)\"/"                 \
+              -e "s/=BRANCH/=\"$(BRANCH)\"/"                   \
+              -e "s/=MAILREL/=\"$(MAILREL)\"/"                 \
+              ./www/release.in                                 \
+             ) > ./www/release.php
+
+#to check if git find difference
+PUB=mailleurXXXXX
+NEWGIT = $(shell cd mailleur ; git diff --exit-code > /dev/null; echo $$?)
+#--------------------------------------------------------------------
diff --git a/lib/subrou.d.29728 b/lib/subrou.d.29728
new file mode 100644 (file)
index 0000000..e69de29