revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / mesa / src / mapi / vgapi / Makefile
blob68cf26e83c370d22539e1c06ee443085408ff592
1 # src/mapi/vgapi/Makefile
3 TOP := ../../..
4 include $(TOP)/configs/current
6 VG_LIB_MAJOR = 1
7 VG_LIB_MINOR = 0
8 VG_LIB_PATCH = 0
10 MAPI := $(TOP)/src/mapi/mapi
12 include $(MAPI)/sources.mak
13 VGAPI_SOURCES := $(addprefix $(MAPI)/, $(MAPI_SOURCES))
14 VGAPI_OBJECTS := $(MAPI_SOURCES:.c=.o)
16 VGAPI_CPPFLAGS := -DMAPI_ABI_HEADER=\"vgapi/vgapi_tmp.h\"
18 GENERATED_SOURCES := vgapi_tmp.h
20 INCLUDE_DIRS := \
21 -I$(TOP)/include \
22 -I$(TOP)/src/mapi
24 .PHONY: default
25 default: depend $(TOP)/$(LIB_DIR)/$(VG_LIB_NAME)
27 $(TOP)/$(LIB_DIR)/$(VG_LIB_NAME): $(VGAPI_OBJECTS)
28 $(MKLIB) -o $(VG_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
29 -major $(VG_LIB_MAJOR) \
30 -minor $(VG_LIB_MINOR) \
31 -patch $(VG_LIB_PATCH) \
32 -id $(INSTALL_LIB_DIR)/lib$(VG_LIB).$(VG_LIB_MAJOR).dylib \
33 $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
34 $(VGAPI_OBJECTS) $(VG_LIB_DEPS)
36 # not used, but kept for completeness
37 libvgapi.a: $(VGAPI_OBJECTS)
38 @$(MKLIB) -o vgapi -static $(VGAPI_OBJECTS)
40 $(VGAPI_SOURCES): | $(GENERATED_SOURCES)
42 $(VGAPI_OBJECTS): %.o: $(MAPI)/%.c
43 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(VGAPI_CPPFLAGS) $< -o $@
45 vgapi_tmp.h: vgapi.csv $(MAPI)/mapi_abi.py
46 $(PYTHON2) $(PYTHON_FLAGS) $(MAPI)/mapi_abi.py \
47 --printer vgapi --mode lib $< > $@
49 .PHONY: clean
50 clean:
51 -rm -f vg.pc
52 -rm -f $(TOP)/$(LIB_DIR)/$(VG_LIB_NAME)
53 -rm -f libvgapi.a
54 -rm -f $(VGAPI_OBJECTS)
55 -rm -f depend depend.bak
56 -rm -f $(GENERATED_SOURCES)
58 pcedit = \
59 -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
60 -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
61 -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
62 -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
63 -e 's,@VG_PC_REQ_PRIV@,$(VG_PC_REQ_PRIV),' \
64 -e 's,@VG_PC_LIB_PRIV@,$(VG_PC_LIB_PRIV),' \
65 -e 's,@VG_PC_CFLAGS@,$(VG_PC_CFLAGS),' \
66 -e 's,@VG_LIB@,$(VG_LIB),'
68 vg.pc: vg.pc.in
69 @sed $(pcedit) $< > $@
71 install-pc: vg.pc
72 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
73 $(INSTALL) -m 644 $< $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
75 install-headers:
76 $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/VG
77 $(INSTALL) -m 644 $(TOP)/include/VG/*.h $(DESTDIR)$(INSTALL_INC_DIR)/VG
79 install: default install-headers install-pc
80 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
81 $(MINSTALL) $(TOP)/$(LIB_DIR)/$(VG_LIB_GLOB) \
82 $(DESTDIR)$(INSTALL_LIB_DIR)
84 # due to a bug in makedepend, cannot pass VGAPI_CPPFLAGS to it
85 $(VGAPI_OBJECTS): vgapi_tmp.h
87 depend: $(VGAPI_SOURCES)
88 @echo "running $(MKDEP)"
89 @touch depend
90 @$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(INCLUDE_DIRS) \
91 $(VGAPI_SOURCES) 2>/dev/null | \
92 sed -e 's,^$(MAPI)/,,' > depend
94 -include depend