1 # src/mapi/glapi/Makefile
4 include $(TOP
)/configs
/current
8 MAPI
= $(TOP
)/src
/mapi
/mapi
11 include $(MAPI
)/sources.mak
18 ifeq ($(SHARED_GLAPI
),1)
21 -DMAPI_ABI_HEADER
=\"glapi
/glapi_mapi_tmp.h
\"
22 glapi_SOURCES
:= $(addprefix $(MAPI
)/, $(MAPI_BRIDGE_SOURCES
))
24 glapi_GLAPI_OBJECTS
:=
26 glapi_MAPI_OBJECTS
:= $(MAPI_BRIDGE_SOURCES
:.c
=.o
)
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
)
37 $(glapi_GLAPI_OBJECTS
) \
38 $(glapi_ASM_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
$@
58 -rm -f
$(glapi_OBJECTS
)
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
68 makedepend_CPPFLAGS
:= $(glapi_CPPFLAGS
)
71 depend
: $(glapi_SOURCES
)
72 @ echo
"running $(MKDEP)"
74 @
$(MKDEP
) $(MKDEP_OPTIONS
) -f-
$(DEFINES
) $(makedepend_CPPFLAGS
) \
75 $(glapi_SOURCES
) 2>/dev
/null | sed
-e
's,^$(MAPI)/,,' > depend