Commits

Ragnara committed 9b277fd

Reorganization; no distributions folder anymore
Handling of buildcounter in Makefiles improved

Comments (0)

Files changed (8)

 buildcounter
 buildcounter.exe
+buildcounter.1.gz
+buildcounter.exe.zip
 CCWIN=i486-mingw32-gcc
 CFLAGS=-std=c11 -g -Wall -Wextra -Werror -pedantic
 
-counted: release count
+all: buildcounter.exe buildcounter buildno.h
 
-
-release: buildcounter.exe buildcounter
-
-
-buildcounter: buildcounter.c
+buildcounter: buildcounter.c 
 	$(CC) $(CFLAGS) -o buildcounter buildcounter.c
 
-buildcounter.exe: buildcounter.c
+buildcounter.exe: buildcounter.c 
 	$(CCWIN) $(CFLAGS) -o buildcounter.exe buildcounter.c	
 
-count:
+buildcounter.exe.zip: buildcounter.exe
+	zip buildcounter.exe.zip buildcounter.exe
+
+manpage: buildcounter.1
+	cat buildcounter.1 | gzip >buildcounter.1.gz
+
+buildno.h: buildcounter.c
 	@buildcounter -s buildno.h || echo "No buildcounting"
 
 clean:
 	-rm buildcounter.exe
 	-rm buildcounter
+	-rm buildcounter.exe.zip
+	-rm buildcounter.1.gz
 
 
-.PHONY: count clean
+.PHONY: clean
 
 
+.\" Manpage for buildcounter.
+.\" Contact b.w@gmx.tm to correct errors or typos.
+.\" Original repository: https://bitbucket.org/Ragnara/buildcounter
+.TH buildcounter 1 "03 Oct 2012" "1.0" "buildcounter man page"
+.SH NAME
+buildcounter \- build counter tool for C/C++ projects
+.SH SYNOPSIS
+\fBbuildcounter\fR <-s> [filename]
+.SH DESCRIPTION
+\fBbuildcounter\fR is a small automatic tool that helps keeping track of different builds for projects in C/C++. It works by creating and modifying a header file with a single define \fBBUILDNO\fR that counts with each invocation starting with 1.
+.SH OPTIONS
+.IP "\fB-s\fR" 4
+Silent mode: Without this parameter, \fBbuildcounter\fR will not only write the define to the given filename, but also to stdout. 
+.SH USING BUILDCOUNTER
+To use \fBbuildcounter\fR for your project, do this:
+.IP "\fB1\fR" 4
+In your source folder, call \fBbuildcounter buildno.h\fR manually. As this creates an internal header file, it should not go into a special include folder.
+.IP "\fB2\fR" 4
+Create a target called "buildno.h" in your makefile. 
+If you do not have a default target containing only dependencies yet, create one. Make it dependend to all necessary build steps and add the "buildno.h" to the end.
+
+\fBExample:\fR
+.IP "" 8 
+all: withoutcounting buildno.h
+
+withoutcounting: a.out
+
+a.out: test.c
+    gcc test.c
+
+buildno.h: test.c
+    buildcounter -s buildno.h
+
+.IP "\fB3\fR" 4
+In your code, include "buildno.h" and use \fBBUILDNO\fR.
+Build your code normally using the default target (or explicitly call "make all"). If you do not want to increase the counter after a specific build, call "make withoutcounting".
+
+.SH REMARKS
+Finding the right place to call \fBbuildcounter\fR allows some easy mistakes.
+It should only be called once for each successful build. That means that you should call it after the real building.
+If you forget to make it dependend of any of your source files, \fBbuildcounter\fR will be called even if there where no changes at all. If you only add some but not all source files, changes of other files will not change the counter.
+
+.SH BUGS
+No known bugs. 
+If you find one, please use \fBhttps://bitbucket.org/Ragnara/buildcounter\fR to create a ticket.
+.SH AUTHOR
+b.w (a) gmx (.) tm
-#define BUILDNO 23
+#define BUILDNO 34

distributions/Makefile

-
-all: windows makefile
-
-windows: ../buildcounter.exe
-	zip out/buildcounter.exe.zip ../buildcounter.exe
-
-makefile: buildcounter.1
-	cat buildcounter.1 | gzip >out/buildcounter.1.gz
-
-clean:
-	-rm out/*
-
-.PHONY: clean
-
-

distributions/buildcounter.1

-.\" Manpage for buildcounter.
-.\" Contact b.w@gmx.tm to correct errors or typos.
-.\" Original repository: https://bitbucket.org/Ragnara/buildcounter
-.TH buildcounter 1 "03 Oct 2012" "1.0" "buildcounter man page"
-.SH NAME
-buildcounter \- build counter tool for C/C++ projects
-.SH SYNOPSIS
-\fBbuildcounter\fR <-s> [filename]
-.SH DESCRIPTION
-\fBbuildcounter\fR is a small automatic tool that helps keeping track of different builds for projects in C/C++. It works by creating and modifying a header file with a single define \fBBUILDNO\fR that counts with each invocation starting with 1.
-.SH OPTIONS
-.IP "\fB-s\fR" 4
-Silent mode: Without this parameter, \fBbuildcounter\fR will not only write the define to the given filename, but also to stdout. 
-.SH USING BUILDCOUNTER
-To use \fBbuildcounter\fR for your project, do this:
-.IP "\fB1\fR" 4
-In your source folder, call \fBbuildcounter buildno.h\fR manually. As this creates an internal header file, it should not go into a special include folder.
-.IP "\fB2\fR" 4
-Create a target called "increasebuildcounter" in your makefile. Make it a .PHONY target.
-If you do not have a default target containing only dependencies yet, create one. Make it dependend to all necessary build steps and add the "increasebuildcounter" to the end.
-
-\fBExample:\fR
-.IP "" 8 
-all: withoutcounting increasebuildcounter
-
-withoutcounting: a.out
-
-a.out: test.c
-    gcc test.c
-
-increasebuildcounter:
-    buildcounter -s buildno.h
-
-.IP "\fB3\fR" 4
-In your code, include "buildno.h" and use \fBBUILDNO\fR.
-Build your code normally using the default target (or explicitly call "make all"). If you do not want to increase the counter after a specific build, call "make withoutcounting".
-
-.SH BUGS
-No known bugs. 
-If you find one, please use \fBhttps://bitbucket.org/Ragnara/buildcounter\fR to create a ticket.
-.SH AUTHOR
-b.w (a) gmx (.) tm

distributions/out/.gitignore

-*
 1
    In your source folder, call **buildcounter buildno.h** manually. As this creates an internal header file, it should not go into a special include folder.
 2
-   Create a target called "increasebuildcounter" in your makefile. Make it a .PHONY target. If you do not have a default target containing only dependencies yet, create one. Make it dependend to all necessary build steps and add the "increasebuildcounter" to the end.
+   Create a target called "buildno.h" in your makefile. If you do not have a default target containing only dependencies yet, create one. Make it dependend to all necessary build steps and add the "buildno.h" to the end.
 
 *Example:*
 
 ::
 
-   all: withoutcounting increasebuildcounter
-   
-   withoutcounting: a.out
+    all: withoutcounting buildno.h
 
-   a.out: test.c
-       gcc test.c
+    withoutcounting: a.out
 
-   increasebuildcounter:
+    a.out: test.c
+        gcc test.c
+
+    buildno.h: test.c
         buildcounter -s buildno.h
 
 3
    In your code, include "buildno.h" and use **BUILDNO**. Build your code normally using the default target (or explicitly call "make all"). If you do not want to increase the counter after a specific build, call "make withoutcounting".
 
+Remarks
+.......
+
+Finding the right place to call buildcounter allows some easy mistakes.
+It should only be called once for each successful build. That means that you should call it after the real building.
+If you forget to make it dependend of any of your source files, buildcounter will be called even if there where no changes at all. If you only add some but not all source files, changes of other files will not change the counter.
+
 
 License
 .......