aboutsummaryrefslogtreecommitdiff
path: root/ninja.m4
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2025-04-10 21:23:08 +0300
committerkartofen <mladenovnasko0@gmail.com>2025-04-10 21:23:08 +0300
commite60275a234a625b3982b9744b5e9aefa2c1f7211 (patch)
treefad0c1492c8bec4e13506edf9f47301152de0822 /ninja.m4
parent844b90ec6b79be309d0bd3d08df36b78d48eee90 (diff)
testing changes
Diffstat (limited to 'ninja.m4')
-rw-r--r--ninja.m428
1 files changed, 14 insertions, 14 deletions
diff --git a/ninja.m4 b/ninja.m4
index 7d6c058..7181a00 100644
--- a/ninja.m4
+++ b/ninja.m4
@@ -5,7 +5,7 @@ define([getenv], [
define([$1], [esyscmd([echo -n $$1])])
ifelse($1, , [
ifelse($2, , [undefine([$1])], [define([$1], [$2])])
-])])
+ ])])
# global vars
getenv([PROD])
@@ -36,8 +36,8 @@ build $bin/msgpack.h: cpy msgpack.h
build $bin/libmsgpack.a: ar $bin/msgpack.o
build $bin/libmsgpack.so: cc $bin/msgpack.o
cflags = $cflags -fPIC -shared
-# build $bin/libmsgpack.h: m4 msgpack.h | msgpack.c
-# m4flags = -D SOURCE=msgpack.c
+build $bin/libmsgpack.h: m4 headeronly.h.m4 | msgpack.c msgpack.h
+ m4flags = -P
# installing
@@ -47,24 +47,24 @@ getenv([LIBDIR], [PREFIX/lib])
getenv([INCLUDEDIR], [PREFIX/include])
divert(0)
-rule cpy_to_dir
- command = cp $$(command ls $pattern 2> /dev/null) $dir
+rule cpy_pattern
+ command = cp $$(command ls $pattern 2> /dev/null) $dest
build force: phony
build $bin/files.dd: m4 builtfiles.dd.m4 | force
m4flags = -D BIN=$bin -D [LIBDIR]=LIBDIR -D [INCLUDEDIR]=INCLUDEDIR
description = Generate dynamic dependency from the built files
-build libs: cpy_to_dir || $bin/files.dd
- dir = LIBDIR
- pattern = $bin/*.a $bin/*.so
- dyndep = $bin/files.dd
+build libs: cpy_pattern || $bin/files.dd
description = Install library files to 'LIBDIR'
-build includes: cpy_to_dir || $bin/files.dd
- dir = INCLUDEDIR
- pattern = $bin/*.h
dyndep = $bin/files.dd
+ dest = LIBDIR
+ pattern = $bin/*.a $bin/*.so
+build headers: cpy_pattern || $bin/files.dd
description = Install header files to 'INCLUDEDIR'
+ dyndep = $bin/files.dd
+ dest = INCLUDEDIR
+ pattern = $bin/*.h
# testing
@@ -80,9 +80,9 @@ rule ninja_clean
build static: phony $bin/libmsgpack.a $bin/msgpack.h
build shared: phony $bin/libmsgpack.so $bin/msgpack.h
-# build header: phony $bin/libmsgpack.h
+build header: phony $bin/libmsgpack.h
-build install: phony libs includes
+build install: phony libs headers
build clean: ninja_clean
build test: valgrind $bin/test