Package: cccc / 1:3.2.0+dfsg1-2

ccccmain-dependency.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From ac6715e8bbbe15fc583e6245013b98ce7f8a960c Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Thu, 5 Dec 2024 13:38:06 +0000
Subject: Add dependency on PCCTS-generated files for compiling ccccmain

The missing dependency was sometimes (on the order of one in four times
on my system) visible when using `make --shuffle` from GNU Make 4.4,
resulting in something like this:

  ccccmain.cc:33:10: fatal error: CParser.h: No such file or directory
     33 | #include "CParser.h"
        |          ^~~~~~~~~~~
  compilation terminated.

It's a bit awkward to handle the way that generating the Ada files is
disabled, but I tried to roughly match the way that `ADA_SPAWN_OBJ` and
`ADA_LANG_DEFINE` are commented out.

Forwarded: https://github.com/sarnold/cccc/pull/46
Last-Update: 2024-12-05

Patch-Name: ccccmain-dependency.patch
---
 cccc/rules.mak | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cccc/rules.mak b/cccc/rules.mak
index 0b73880..6897e3a 100644
--- a/cccc/rules.mak
+++ b/cccc/rules.mak
@@ -115,6 +115,7 @@ JAVA_LANG_DEFINE=-DJAVA_INCLUDED
 #ADA_SPAWN_OBJ=ada.$(OBJEXT) ALexer.$(OBJEXT) AdaPrser.$(OBJEXT)
 #ADA_LANG_DEFINE=-DADA_INCLUDED
 
+SPAWN = $(CCCC_SPAWN) $(JAVA_SPAWN) # $(ADA_SPAWN)
 SPAWN_OBJ = $(CCCC_SPAWN_OBJ) $(JAVA_SPAWN_OBJ) $(ADA_SPAWN_OBJ)
 LANG_DEFINES = $(CC_LANG_DEFINE) $(JAVA_LANG_DEFINE) $(ADA_LANG_DEFINE)
 
@@ -148,7 +149,7 @@ $(CCCC_EXE): $(USR_G) $(ANLTR_SPAWN) $(DLG_SPAWN) $(USR_H) $(USR_C) $(ALL_OBJ)
 	$(ANTLR) $(AFLAGS) -gc -gx -pa $< > $*.1st
 	$(ANTLR) $(AFLAGS) -gc -gx -cr $< > $*.xrf
 
-ccccmain.$(OBJEXT) : ccccmain.cc 
+ccccmain.$(OBJEXT) : ccccmain.cc $(SPAWN)
 	$(CCC) $(CCC_OPTS) $(LANG_DEFINES) ccccmain.cc