Thread (90 messages) 90 messages, 5 authors, 2022-05-26
STALE1470d
Revisions (5)
  1. v1 [diff vs current]
  2. v1 current
  3. v2 [diff vs current]
  4. v3 [diff vs current]
  5. v4 [diff vs current]

[PATCH v2 2/9] Makefile: generate "po/git.pot" from stable LOCALIZED_C

From: Jiang Xin <hidden>
Date: 2022-05-19 08:16:51
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

From: Jiang Xin <redacted>

When running "make pot" on different platform, we may get a different
message template file "po/git.pot". This is because the "LOCALIZED_C"
variable may have different C source files on different platforms or
different compiler conditions.

We can make a stable "LOCALIZED_C" variable by applying patch snippets
as follows:

     ifdef NO_LIBGEN_H
         COMPAT_CFLAGS += -DNO_LIBGEN_H
         COMPAT_OBJS += compat/basename.o
    +else
    +    LOCALIZED_C += compat/basename.c
     endif

But it is much simpler to use variables "$(FOUND_C_SOURCES)" and
"$(FOUND_C_SOURCES)" to form a stable "LOCALIZED_C".

With this update, the newly generated "po/git.pot" will have 30 new
entries coming from the following C source files:

 * compat/fsmonitor/fsm-listen-win32.c
 * compat/mingw.c
 * compat/regex/regcomp.c
 * compat/simple-ipc/ipc-win32.c

Signed-off-by: Jiang Xin <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 83e968e2a4..60ca42c268 100644
--- a/Makefile
+++ b/Makefile
@@ -2714,7 +2714,8 @@ XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
 	--keyword=gettextln --keyword=eval_gettextln
 XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \
 	--keyword=__ --keyword=N__ --keyword="__n:1,2"
-LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
+LOCALIZED_C = $(FOUND_C_SOURCES) $(SCALAR_SOURCES) \
+	      $(FOUND_H_SOURCES) $(GENERATED_H)
 LOCALIZED_SH = $(SCRIPT_SH)
 LOCALIZED_SH += git-sh-setup.sh
 LOCALIZED_PERL = $(SCRIPT_PERL)
-- 
2.36.0.1.g15c4090757
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help