make-leapsecs_table (701B)
1 #!/command/execlineb -P 2 3 # Compile convert-leapsecs.c, then use this to create 4 # src/libstddjb/leapsecs_table.c 5 6 define PREFIX ./tools 7 8 backtick -n N 9 { 10 pipeline 11 { 12 redirfd -r 0 ${PREFIX}/leapsecs.txt 13 ${PREFIX}/convert-leapsecs 14 } 15 wc -l 16 } 17 import -u N 18 19 if 20 { 21 s6-echo "/* ISC license. */ 22 23 /* This file has been generated by ./tools/make-leapsecs_table */ 24 25 #include <skalibs/uint64.h> 26 #include <skalibs/tai.h> 27 #include \"djbtime-internal.h\" 28 29 unsigned int const leapsecs_table_len = ${N} ; 30 static uint64_t const leapsecs_table_[${N}] =\n{" 31 } 32 33 if 34 { 35 redirfd -r 0 ${PREFIX}/leapsecs.txt 36 ${PREFIX}/convert-leapsecs 37 } 38 39 s6-echo "} ;\nuint64_t const *const leapsecs_table = leapsecs_table_ ;"