summaryrefslogtreecommitdiff
blob: 5d69a25d65afbfb103c3ece89ca6cd03bdb84174 (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
Makefile: Fix parallel build issue

If clean runs in parallel with $(OBJECTS), it is possible to build some
objects first, then the clean target fires and deletes some, and then we
try to link and fail.

Gentoo-Bug: https://bugs.gentoo.org/528218

--- a/makefile
+++ b/makefile
@@ -139,23 +139,23 @@ uninstall:	uninstall-unrar
 
 clean:
 	@rm -f *.o *.bak *~
-
-unrar:	clean $(OBJECTS) $(UNRAR_OBJ)
 	@rm -f unrar
+	@rm -f default.sfx
+	@rm -f libunrar.so
+	@rm -f libunrar.a
+
+unrar:	$(OBJECTS) $(UNRAR_OBJ)
 	$(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)	
 	$(STRIP) unrar
 
 sfx:	WHAT=SFX_MODULE
-sfx:	clean $(OBJECTS)
-	@rm -f default.sfx
+sfx:	$(OBJECTS)
 	$(LINK) -o default.sfx $(LDFLAGS) $(OBJECTS)
 	$(STRIP) default.sfx
 
 lib:	WHAT=RARDLL
 lib:	CXXFLAGS+=$(LIBFLAGS)
-lib:	clean $(OBJECTS) $(LIB_OBJ)
-	@rm -f libunrar.so
-	@rm -f libunrar.a
+lib:	$(OBJECTS) $(LIB_OBJ)
 	$(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
 	$(AR) rcs libunrar.a $(OBJECTS) $(LIB_OBJ)
 
-- 
2.13.1