summaryrefslogtreecommitdiff
path: root/system/arj/patches/004_parallel_build.patch
blob: bed4a406aea6aa6528384cb5b0c4042346d400fe (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
Description: Fix upstream build sysstem to support parallel builds.
Author: Guillem Jover <guillem@debian.org>
Origin: vendor
Forwarded: no
Last-Update: 2007-12-05

---
 gnu/makefile.in |   74 +++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 44 insertions(+), 30 deletions(-)

--- a/gnu/makefile.in
+++ b/gnu/makefile.in
@@ -159,13 +159,15 @@ $(SFXSTUB_DIR)/%.o: $(SRC_DIR)/%.c
 # Main dependency tree
 #
 
-.PHONY: timestamp prepare cleanup package help
+.PHONY: timestamp msg-headers depends prepare clean package help
 
 ifdef COMMERCIAL
 MAKE_KEY=$(TOOLS_DIR)/make_key$x
 endif
 
 all:	prepare timestamp
+	$(MAKE) msg-headers
+	$(MAKE) depends
 	$(MAKE) do-all
 
 do-all:	\
@@ -175,8 +177,28 @@ do-all:	\
 	$(REGISTER_DIR)/$(REGISTER)$x \
 	$(ARJDISP_DIR)/arjdisp$x \
 	$(TOOLS_DIR)/packager$x \
-        $(MAKE_KEY) \
-	dispose
+	$(MAKE_KEY)
+
+MSG_ID := \
+	msg_crp msg_stb msg_sfv msg_sfx msg_sfj msg_arj msg_rej msg_reg msg_adi
+MSG_HEADERS := $(patsubst %,$(BASEDIR)/%.h,$(MSG_ID))
+
+msg-headers: $(MSG_HEADERS)
+
+.deps:
+	mkdir -p $@
+
+.deps/%.d: %.c .deps
+	$(CC) $(CPPFLAGS) $(COPT) $< -MM > $@
+
+SOURCES = $(wildcard *.c)
+DEPS = $(addprefix .deps/,$(SOURCES:.c=.d))
+
+ifeq ($(sort $(DEPS)),$(sort $(wildcard .deps/*.d)))
+include $(DEPS)
+endif
+
+depends: $(DEPS)
 
 #
 # Update timestamp file
@@ -186,12 +208,6 @@ timestamp: $(TOOLS_DIR)/today$x
 	$(TOOLS_DIR)/today$x $(LOCALE) $(BASEDIR)
 
 #
-# Final cleanup
-#
-
-dispose:
-
-#
 # The tools
 #
 
@@ -255,7 +271,7 @@ $(ARJCRYPT_DIR)/arjcrypt$d: $(ARJCRYPT_O
 	$(CC) $(ALL_CFLAGS) $(DLL_FLAGS) -o $@ $(ARJCRYPT_OBJS) $(ARJCRYPT_DEF) $(LIBS)
 	$(TOOLS_DIR)/postproc $@
 
-$(BASEDIR)/nmsg_crp.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
+$(BASEDIR)/nmsg_crp.c $(BASEDIR)/msg_crp.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_crp $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
 
 #
@@ -269,7 +285,7 @@ $(SFXSTUB_DIR)/sfxstub$x: $(SFXSTUB_OBJS
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(SFXSTUB_OBJS) $(LIBS)
 	$(TOOLS_DIR)/postproc$x $@ -sfx
 
-$(BASEDIR)/nmsg_stb.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
+$(BASEDIR)/nmsg_stb.c $(BASEDIR)/msg_stb.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_stb $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
 
 #
@@ -287,7 +303,8 @@ $(ARJSFXV_DIR)/arjsfxv$x: $(ARJSFXV_OBJS
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXV_OBJS) $(LIBS) $(DYN_LIBS)
 	$(TOOLS_DIR)/postproc$x $@ -sfx
 
-$(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
+$(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c \
+$(BASEDIR)/msg_sfv.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_sfv $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
 
 #
@@ -304,7 +321,8 @@ $(ARJSFX_DIR)/arjsfx$x: $(ARJSFX_OBJS) $
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFX_OBJS) $(LIBS)
 	$(TOOLS_DIR)/postproc$x $@ -sfx
 
-$(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
+$(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c \
+$(BASEDIR)/msg_sfx.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_sfx $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
 
 #
@@ -319,7 +337,8 @@ $(ARJSFXJR_DIR)/arjsfxjr$x: $(ARJSFXJR_O
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXJR_OBJS) $(LIBS)
 	$(TOOLS_DIR)/postproc$x $@ -sfx
 
-$(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
+$(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c \
+$(BASEDIR)/msg_sfj.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_sfj $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
 
 #
@@ -354,7 +373,8 @@ $(ARJ_DIR)/arj$x: $(ARJ_OBJS) \
 	$(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(BASEDIR)/help.arj
 	$(TOOLS_DIR)/postproc $@
 
-$(BASEDIR)/fmsg_arj.c $(BASEDIR)/imsg_arj.c $(BASEDIR)/nmsg_arj.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
+$(BASEDIR)/fmsg_arj.c $(BASEDIR)/imsg_arj.c $(BASEDIR)/nmsg_arj.c \
+$(BASEDIR)/msg_arj.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_arj $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
 
 #
@@ -372,7 +392,8 @@ $(REARJ_DIR)/rearj$x: $(REARJ_OBJS) \
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REARJ_OBJS) $(LIBS)
 	$(TOOLS_DIR)/postproc $@
 
-$(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
+$(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c \
+$(BASEDIR)/msg_rej.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_rej $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
 
 #
@@ -388,7 +409,8 @@ $(REGISTER_DIR)/$(REGISTER)$x: $(REGISTE
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REGISTER_OBJS) $(LIBS)
 	$(TOOLS_DIR)/postproc $@ -sfx
 
-$(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
+$(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c \
+$(BASEDIR)/msg_reg.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_reg $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
 
 #
@@ -402,7 +424,8 @@ ARJDISP_OBJS = $(patsubst %,$(ARJDISP_DI
 $(ARJDISP_DIR)/arjdisp$x: $(ARJDISP_OBJS)
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJDISP_OBJS) $(LIBS)
 
-$(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)
+$(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c \
+$(BASEDIR)/msg_adi.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)
 	$(TOOLS_DIR)/msgbind $(RESFILE) msg_adi $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)
 
 #
@@ -427,18 +450,9 @@ prepare:
 #
 
 clean:
-	-rm -f $(BASEDIR)/*
-	-rm -f $(TOOLS_DIR)/*
-	-rm -f $(ARJCRYPT_DIR)/*
-	-rm -f $(SFXSTUB_DIR)/*
-	-rm -f $(ARJSFXV_DIR)/*
-	-rm -f $(ARJSFX_DIR)/*
-	-rm -f $(ARJSFXJR_DIR)/*
-	-rm -f $(ARJ_DIR)/*
-	-rm -f $(REARJ_DIR)/*
-	-rm -f $(REGISTER_DIR)/*
-	-rm -f $(ARJDISP_DIR)/*
-	-rm -f arj.core
+	rm -rf .deps
+	rm -rf $(BASEDIR)
+	rm -f arj.core
 
 #
 # Local installation