3 # Get settings from the output of configure by running it to generate
4 # Makefile.config if it doesn't exist yet.
6 # If Makefile.config doesn't exist, then srcdir won't be
7 # set. Conditionally set it (assuming a plain srcdir build) so that
8 # the rule to generate Makefile.config can actually work.
11 include Makefile.config
12 Makefile.config: $(srcdir)/configure
13 ifeq ($(configure_options),)
15 @echo "Note: Calling ./configure with no command-line arguments. This is often fine,"
16 @echo " but if you want to specify any arguments (such as an alternate prefix"
17 @echo " into which to install), call ./configure explicitly and then make again."
18 @echo " See \"./configure --help\" for more details."
21 $(srcdir)/configure $(configure_options)
23 LIBGLAZE_LINKER_NAME = libglaze.so
24 LIBGLAZE_SONAME = $(LIBGLAZE_LINKER_NAME).$(MAJOR)
25 LIBGLAZE_LIBNAME = $(LIBGLAZE_SONAME).$(MINOR).$(RELEASE)
27 LIBGLAZE_32_LINKER_NAME = libglaze-32.so
28 LIBGLAZE_32_SONAME = $(LIBGLAZE_32_LINKER_NAME).$(MAJOR)
29 LIBGLAZE_32_LIBNAME = $(LIBGLAZE_32_SONAME).$(MINOR).$(RELEASE)
31 ifeq ($(COMPILER_SUPPORTS_32),Yes)
32 TARGETS += $(LIBGLAZE_32_LIBNAME)
33 TARGETS += $(LIB32_DIR)/libGL.so.1
34 TARGETS += glaze-find-libgl-32
37 ifeq ($(COMPILER_SUPPORTS_64),Yes)
38 TARGETS += $(LIBGLAZE_LIBNAME)
39 TARGETS += $(LIB64_DIR)/libGL.so.1
40 TARGETS += glaze-find-libgl-64
45 GLAZE_CFLAGS = $(CFLAGS) $(WARN_CFLAGS)
47 $(LIBGLAZE_32_LIBNAME): glaze.c
48 $(CC) $(GLAZE_CFLAGS) -m32 -fPIC -shared -Wl,-Bsymbolic,-soname=$(LIBGLAZE_SONAME) -ldl -ltalloc -o $@ $<
50 $(LIBGLAZE_LIBNAME): glaze.c
51 $(CC) $(GLAZE_CFLAGS) -m64 -fPIC -shared -Wl,-Bsymbolic,-soname=$(LIBGLAZE_SONAME) -ldl -ltalloc -o $@ $<
53 $(LIB64_DIR)/libGL.so.1: glaze-gl.c
55 $(CC) $(GLAZE_CFLAGS) -DGLAZE_BITS=64 -m64 -fPIC -shared -Wl,-Bsymbolic -o $@ $<
57 $(LIB32_DIR)/libGL.so.1: glaze-gl.c specs/gl.def
59 $(CC) $(GLAZE_CFLAGS) -DGLAZE_BITS=32 -m32 -fPIC -shared -Wl,-Bsymbolic -o $@ $<
61 glaze-find-libgl-32: glaze-find-libgl.c
62 $(CC) $(GLAZE_CFLAGS) -m32 -fPIC -ldl -o $@ $<
64 glaze-find-libgl-64: glaze-find-libgl.c
65 $(CC) $(GLAZE_CFLAGS) -m64 -fPIC -ldl -o $@ $<
69 mkdir -p $(DESTDIR)$(INCLUDEDIR)/glaze
70 install -m0644 glaze.h $(DESTDIR)$(INCLUDEDIR)/glaze
71 mkdir -p $(DESTDIR)$(BINDIR)
72 mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
73 ifeq ($(COMPILER_SUPPORTS_32),Yes)
74 mkdir -p $(DESTDIR)$(LIBDIR)/glaze/$(LIB32_DIR)
75 install -m0644 $(LIB32_DIR)/libGL.so.1 $(DESTDIR)$(LIBDIR)/glaze/$(LIB32_DIR)
76 ln -sf libGL.so.1 $(DESTDIR)$(LIBDIR)/glaze/$(LIB32_DIR)/libGL.so
77 install -m0644 $(LIBGLAZE_32_LIBNAME) $(DESTDIR)$(LIBDIR)
78 ln -sf $(LIBGLAZE_32_LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBGLAZE_32_SONAME)
79 ln -sf $(LIBGLAZE_32_LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBGLAZE_32_LINKER_NAME)
80 install glaze-32.pc $(DESTDIR)$(LIBDIR)/pkgconfig
81 install -m0755 glaze-find-libgl-32 $(DESTDIR)$(BINDIR)
83 ifeq ($(COMPILER_SUPPORTS_64),Yes)
84 mkdir -p $(DESTDIR)$(LIBDIR)/glaze/$(LIB64_DIR)
85 install -m0644 $(LIB64_DIR)/libGL.so.1 $(DESTDIR)$(LIBDIR)/glaze/$(LIB64_DIR)
86 ln -sf libGL.so.1 $(DESTDIR)$(LIBDIR)/glaze/$(LIB64_DIR)/libGL.so
87 install -m0644 $(LIBGLAZE_LIBNAME) $(DESTDIR)$(LIBDIR)
88 ln -sf $(LIBGLAZE_LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBGLAZE_SONAME)
89 ln -sf $(LIBGLAZE_LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBGLAZE_LINKER_NAME)
90 install glaze.pc $(DESTDIR)$(LIBDIR)/pkgconfig
91 install -m0755 glaze-find-libgl-64 $(DESTDIR)$(BINDIR)