fixed makefile to build on IRIX by auto-detecting it needs to link with
authorJohn Tsiombikas <nuclear@member.fsf.org>
Fri, 29 May 2020 15:01:09 +0000 (18:01 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Fri, 29 May 2020 15:01:09 +0000 (18:01 +0300)
libc and disable the inline assembly hacks

Makefile

index accf05a..9c5f31f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,14 +4,24 @@ bin = test
 
 CFLAGS = -pedantic -Wall -g
 
+isx86 ?= $(shell uname -m | sed 's/x86_64/x86/; s/i.86/x86/')
+
 sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/')
 ifeq ($(sys), mingw)
        obj = $(src:.c=.w32.o)
        bin = test.exe
 
        LDFLAGS = -mconsole -lopengl32 -lgdi32 -lwinmm
-else
+else ifeq ($(sys)-$(isx86), Linux-x86)
        LDFLAGS = -lX11 -lGL
+else
+       # for other UNIX or non-x86 where sys_ and trig functions are not
+       # implemented, just use libc
+       CFLAGS += -DMINIGLUT_USE_LIBC
+       LDFLAGS = -lX11 -lGL -lm
+       ifeq ($(sys), IRIX)
+               CC = gcc
+       endif
 endif
 
 $(bin): $(obj)