poe

Уређивач .po фајлова
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување 56241151bf4c614e256a4212d64b68806c31c050
родитељ c6e0259f3c67da67fd46a8defe15e381c2dbe995
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Sun, 12 Mar 2023 23:15:02 +0100

Add config.h support to redo scripts

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
M.gitignore | 1+
A_config.h.do | 7+++++++
Mdefault.o.do | 8++------
Mdraw.c | 2+-
Mpo.c | 2+-
Mpoe.c | 2+-
Mpoe.do | 8+-------
измењених датотека: 7, додавања: 14(+), брисања: 16(-)

diff --git a/.gitignore b/.gitignore @@ -20,6 +20,7 @@ nohup.out *.pkg.tar.zst src PKGBUILD +_config.h config.h poe poe.1 diff --git a/_config.h.do b/_config.h.do @@ -0,0 +1,7 @@ +hfile=${1#_} +if [ ! -r $hfile ]; then + cat config.def.h >$hfile +fi +cat $hfile >$3 +redo-always +redo-stamp <$3 diff --git a/default.o.do b/default.o.do @@ -1,8 +1,4 @@ -{ for f in *.h; do - echo $f -done -if [ ! -r config.h ]; then - echo config.h -fi; } | sort | uniq | xargs redo-ifchange +sed -n '/^#include "/s/^#include "\([^"]*\)"/\1/p' ${2%.o}.c | \ + xargs redo-ifchange redo-ifchange $2.c ${POE_CC:-gcc -g} -Wall -std=c99 -c $2.c -o $3 diff --git a/draw.c b/draw.c @@ -13,7 +13,7 @@ #include "util.h" #include "po.h" #include "draw.h" -#include "config.h" +#include "_config.h" /* clang-format off */ static const char* help_title = "Main view help"; diff --git a/po.c b/po.c @@ -17,7 +17,7 @@ #include "util.h" #include "po.h" #include "draw.h" -#include "config.h" +#include "_config.h" extern const char* errors[]; extern const char* flag_strings[]; diff --git a/poe.c b/poe.c @@ -23,7 +23,7 @@ #include "util.h" #include "po.h" #include "draw.h" -#include "config.h" +#include "_config.h" extern const char* backup_suffix; extern const char* errors[]; diff --git a/poe.do b/poe.do @@ -1,8 +1,2 @@ -for f in *.h.in; do - echo $f | sed -e's/\.in$//g' -done | xargs redo-ifchange -for f in *.h *.c; do - echo $f - echo $f | sed -e's/\.c$/.o/g' -done | xargs redo-ifchange +redo-ifchange po.o poe.o draw.o util.o ${POE_CC:-gcc -g} -Wall -std=c99 -o $3 po.o poe.o draw.o util.o >/dev/null