Removed all code that uses OpenGL from Image.
[io/quag.git] / addons / AppleExtras / Makefile
blobbbac027ed3c580eea4a8c0cddbaecd42820410dd
1 #include ../../Makefile.preamble
3 #CC := g++
5 RANLIB ?= ranlib
6 AR ?= ar rcu
8 # may need to remove --param max-inline-insns-single=500 for older versions of gccs
9 WARN :=-Wall -Wstrict-prototypes -Winline
10 #--param max-inline-insns-single=500
12 #-ansi -pedantic
13 OPTIMIZE :=-Os -fPIC
15 dependson := $(shell cat depends) || ""
17 HEADERS :=-I.
18 others := $(dependson)
19 others := $(addprefix -I../,$(others))
20 others := $(addsuffix /_headers,$(others))
21 HEADERS += $(others)
23 DLL_L := $(dependson)
24 DLL_L := $(addprefix -L../,$(DLL_L))
25 DLL_L := $(addsuffix /_dll,$(DLL_L))
27 DLL_l := $(dependson)
28 DLL_l := $(addprefix -l,$(DLL_l))
30 CFLAGS := $(OPTIMIZE) $(WARN) $(HEADERS) #--param max-inline-insns-single=500
32 # Uncommment for Coros to register their stack with Valgrind
33 #CFLAGS += -DUSE_VALGRIND
35 ### PLATFORM #####################################################
37 SYS ?= $(shell uname -s)
39 ifeq ($(SYS),Darwin)
40 CFLAGS += -falign-loops=16
41 endif
43 ifeq ($(SYS),IRIX)
44 RANLIB ?= touch
45 endif
47 ifeq ($(SYS),Darwin)
48 DLL_SUFFIX := dylib
49 DLL_COMMAND := -dynamiclib
50 FLAT_NAMESPACE := -flat_namespace
51 else
52 DLL_SUFFIX := so
53 DLL_COMMAND := -shared
54 FLAT_NAMESPACE :=
55 endif
57 ### FILES #########################################################
59 NAME := $(notdir $(shell pwd))
60 LIBR := _lib/lib$(NAME).a
61 DLL := _dll/lib$(NAME).$(DLL_SUFFIX)
62 infiles := $(wildcard source/*.c) $(wildcard *.S)
63 objects := $(notdir $(infiles))
64 objects := $(basename $(objects))
65 objects := $(addsuffix .o,$(objects))
66 objects := $(addprefix _objs/,$(objects))
68 ### RULES ###########################################################
70 all:
71 mkdir -p _objs
72 mkdir -p _headers
73 mkdir -p _lib
74 mkdir -p _dll
75 $(MAKE) $(LIBR)
76 $(MAKE) $(DLL)
77 cp source/*.h _headers
79 _objs/%.o: source/%.c
80 $(CC) $(CFLAGS) -c $< -o $@
82 $(LIBR): $(objects)
83 $(AR) $@ $(objects)
84 $(RANLIB) $@
86 $(DLL): $(objects)
87 $(CC) $(DLL_COMMAND) $(FLAT_NAMESPACE) $(DLL_L) $(DLL_l) $(objects) -o $(DLL)
89 clean:
90 rm -rf _headers
91 rm -rf _objs
92 rm -rf _lib