add new dist target

Fri, 29 Sep 2023 20:07:20 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 29 Sep 2023 20:07:20 +0200
changeset 69
186e41b332d9
parent 68
ae763178ee1e
child 70
8de477fe19eb

add new dist target

Makefile file | annotate | diff | comparison | revisions
src/Makefile file | annotate | diff | comparison | revisions
src/cline.h file | annotate | diff | comparison | revisions
--- a/Makefile	Fri Sep 22 23:26:23 2023 +0200
+++ b/Makefile	Fri Sep 29 20:07:20 2023 +0200
@@ -21,13 +21,18 @@
 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+VERSION=1.4.1
 
 all: build config.mk FORCE
-	@cd src && $(MAKE) -s
+	@cd src && $(MAKE) -s VERSION=$(VERSION)
 
-install: build config.mk FORCE
+install:
 	@cd src && $(MAKE) -s install
 
+dist:
+	tar -czf cline-$(VERSION).tar.gz -Hustar \
+		README LICENSE Makefile configure make src test
+
 build:
 	@mkdir -p build
 
--- a/src/Makefile	Fri Sep 22 23:26:23 2023 +0200
+++ b/src/Makefile	Fri Sep 29 20:07:20 2023 +0200
@@ -41,6 +41,6 @@
 
 $(BUILD_DIR)/%.o: %.c
 	echo "Compiling $<"
-	$(CC) $(CFLAGS) -c -o $@ $<
+	$(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c -o $@ $<
 
-FORCE:
\ No newline at end of file
+FORCE:
--- a/src/cline.h	Fri Sep 22 23:26:23 2023 +0200
+++ b/src/cline.h	Fri Sep 29 20:07:20 2023 +0200
@@ -27,7 +27,9 @@
 #ifndef CLINE_H_
 #define CLINE_H_
 
-#define VERSION "1.4.1"
+#ifndef VERSION
+#error "VERSION macro must be set by build system"
+#endif
 
 #include "stdinc.h"
 #include "settings.h"

mercurial