Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / mesa / src / mapi / glapi / Makefile
blobbb4ed6585d9df62aabfb8ab4803934ae27373847
1 # src/mapi/glapi/Makefile
3 TOP = ../../..
4 include $(TOP)/configs/current
6 TARGET = glapi
8 MAPI = $(TOP)/src/mapi/mapi
10 include sources.mak
11 include $(MAPI)/sources.mak
13 glapi_CPPFLAGS := \
14 -I$(TOP)/include \
15 -I$(TOP)/src/mapi \
16 -I$(TOP)/src/mesa
18 ifeq ($(SHARED_GLAPI),1)
19 glapi_CPPFLAGS += \
20 -DMAPI_MODE_BRIDGE \
21 -DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
22 glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_SOURCES))
24 glapi_GLAPI_OBJECTS :=
25 glapi_ASM_OBJECTS :=
26 glapi_MAPI_OBJECTS := $(MAPI_BRIDGE_SOURCES:.c=.o)
27 else
28 glapi_CPPFLAGS += -DMAPI_MODE_UTIL
29 glapi_SOURCES := $(GLAPI_SOURCES) $(addprefix $(MAPI)/, $(MAPI_UTIL_SOURCES))
31 glapi_GLAPI_OBJECTS := $(GLAPI_SOURCES:.c=.o)
32 glapi_ASM_OBJECTS := $(GLAPI_ASM_SOURCES:.S=.o)
33 glapi_MAPI_OBJECTS := $(MAPI_UTIL_SOURCES:.c=.o)
34 endif # SHARED_GLAPI
36 glapi_OBJECTS := \
37 $(glapi_GLAPI_OBJECTS) \
38 $(glapi_ASM_OBJECTS) \
39 $(glapi_MAPI_OBJECTS)
41 default: depend lib$(TARGET).a
43 lib$(TARGET).a: $(glapi_OBJECTS)
44 @$(MKLIB) -o $(TARGET) -static $(glapi_OBJECTS)
46 $(glapi_GLAPI_OBJECTS): %.o: %.c
47 $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
49 $(glapi_ASM_OBJECTS): %.o: %.S
50 $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
52 $(glapi_MAPI_OBJECTS): %.o: $(MAPI)/%.c
53 $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
55 install:
57 clean:
58 -rm -f $(glapi_OBJECTS)
59 -rm -f lib$(TARGET).a
60 -rm -f depend depend.bak
62 ifeq ($(SHARED_GLAPI),1)
63 # workaround a bug in makedepend
64 makedepend_CPPFLAGS := \
65 $(filter-out -DMAPI_ABI_HEADER=%, $(glapi_CPPFLAGS))
66 $(glapi_OBJECTS): glapi_mapi_tmp.h
67 else
68 makedepend_CPPFLAGS := $(glapi_CPPFLAGS)
69 endif
71 depend: $(glapi_SOURCES)
72 @ echo "running $(MKDEP)"
73 @ touch depend
74 @$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(makedepend_CPPFLAGS) \
75 $(glapi_SOURCES) 2>/dev/null | sed -e 's,^$(MAPI)/,,' > depend
77 -include depend