Package: nim / 0.16.0-1

fix-makefile-unsupported-arch.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
48
49
50
51
52
53
54
55
56
57
Description: Fix Makefile syntax for unsupported architectures
Author: Ximin Luo <infinity0@pwned.gg>
Bug: https://github.com/nim-lang/Nim/pull/3115
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/makefile
+++ b/makefile
@@ -414,6 +414,7 @@
 	endif
 endif
 
+.check-arch:
 ifeq ($(strip $(oFiles)),)
 	@echo "Error: no C code generated for: [$(myos): $(mycpu)]"
 	@exit 1
@@ -422,12 +423,12 @@
 %.o: %.c
 	$(CC) $(COMP_FLAGS) -Ic_code -c $< -o $@
 
-$(binDir)/nim: $(oFiles)
+$(binDir)/nim: .check-arch $(oFiles)
 	@mkdir -p $(binDir)
-	$(LINKER) -o $@ $^ $(LINK_FLAGS)
+	$(LINKER) -o $@ $(oFiles) $(LINK_FLAGS)
 	@echo "SUCCESS"
 
-.PHONY: clean
+.PHONY: clean .check-arch
 
 clean:
 	rm -f $(oFiles) $(binDir)/nim
--- a/tools/niminst/makefile.tmpl
+++ b/tools/niminst/makefile.tmpl
@@ -149,6 +149,7 @@
 endif
 # end for
 
+.check-arch:
 ifeq ($(strip $(oFiles)),)
 	@echo "Error: no C code generated for: [$(myos): $(mycpu)]"
 	@exit 1
@@ -157,12 +158,12 @@
 %.o: %.c
 	$(CC) $(COMP_FLAGS) -Ic_code -c $< -o $@
 
-?{"$(binDir)/" & toLowerAscii(c.name)}: $(oFiles)
+?{"$(binDir)/" & toLowerAscii(c.name)}: .check-arch $(oFiles)
 	@mkdir -p $(binDir)
-	$(LINKER) -o $@ $^ $(LINK_FLAGS)
+	$(LINKER) -o $@ $(oFiles) $(LINK_FLAGS)
 	@echo "SUCCESS"
 
-.PHONY: clean
+.PHONY: clean .check-arch
 
 clean:
 	rm -f $(oFiles) ?{"$(binDir)/" & toLowerAscii(c.name)}