Skip to content

Commit e0c50c3

Browse files
committed
makefile.nimf: fix for Darwin PPC
1 parent d652367 commit e0c50c3

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

tools/niminst/makefile.nimf

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,28 @@ ifeq ($(uos),netbsd)
4747
endif
4848
ifeq ($(uos),darwin)
4949
myos = macosx
50-
CC = clang
5150
LDFLAGS += -ldl -lm
5251
ifeq ($(HOSTTYPE),x86_64)
5352
ucpu = amd64
5453
endif
54+
ifeq ($(ucpu),i386)
55+
CC = clang
56+
endif
57+
ifeq ($(ucpu),amd64)
58+
CC = clang
59+
endif
60+
ifeq ($(ucpu),arm64)
61+
CC = clang
62+
endif
63+
ifeq ($(ucpu),aarch64)
64+
CC = clang
65+
endif
66+
ifeq ($(ucpu),ppc)
67+
CC = gcc
68+
endif
69+
ifeq ($(ucpu),ppc64)
70+
CC = gcc
71+
endif
5572
endif
5673
ifeq ($(uos),aix)
5774
myos = aix
@@ -118,6 +135,14 @@ ifeq ($(ucpu),ppc64)
118135
CFLAGS += -m64
119136
LDFLAGS += -m64
120137
endif
138+
ifeq ($(myos),freebsd)
139+
CFLAGS += -m64
140+
LDFLAGS += -m64
141+
endif
142+
ifeq ($(myos),macosx)
143+
CFLAGS += -arch ppc64
144+
LDFLAGS += -arch ppc64
145+
endif
121146
endif
122147
ifeq ($(ucpu),powerpc)
123148
mycpu = powerpc
@@ -131,7 +156,11 @@ ifeq ($(ucpu),powerpc)
131156
endif
132157
endif
133158
ifeq ($(ucpu),ppc)
134-
mycpu = ppc
159+
mycpu = powerpc
160+
ifeq ($(myos),macosx)
161+
CFLAGS += -arch ppc
162+
LDFLAGS += -arch ppc
163+
endif
135164
endif
136165
ifneq (,$(filter $(ucpu), mips mips64))
137166
mycpu = $(shell /bin/sh -c '"$(CC)" -dumpmachine | sed "s/-.*//"')

0 commit comments

Comments
 (0)