]> git.cworth.org Git - glaze/blob - Makefile
Makefile: Fix to enable compiler warnings
[glaze] / Makefile
1 all:
2
3 # Get settings from the output of configure by running it to generate
4 # Makefile.config if it doesn't exist yet.
5
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.
9 srcdir ?= .
10
11 include Makefile.config
12 Makefile.config: $(srcdir)/configure
13 ifeq ($(configure_options),)
14         @echo ""
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."
19         @echo ""
20 endif
21         $(srcdir)/configure $(configure_options)
22
23 LIBGLAZE_LINKER_NAME = libglaze.so
24 LIBGLAZE_SONAME = $(LIBGLAZE_LINKER_NAME).$(MAJOR)
25 LIBGLAZE_LIBNAME = $(LIBGLAZE_SONAME).$(MINOR).$(RELEASE)
26
27 TARGETS = $(LIBGLAZE_LIBNAME) lib64/libGL.so.1 lib32/libGL.so.1
28
29 all: $(TARGETS)
30
31 GLAZE_CFLAGS = $(CFLAGS) $(WARN_CFLAGS)
32
33 $(LIBGLAZE_LIBNAME): glaze.c
34         $(CC) $(GLAZE_CFLAGS) -fPIC -shared -Wl,-Bsymbolic,-soname=$(LIBGLAZE_SONAME) -ldl -o $@ $<
35
36 lib64/libGL.so.1: glaze-gl.c glapi.def
37         mkdir -p lib64
38         $(CC) $(GLAZE_CFLAGS) -m64 -fPIC -shared -Wl,-Bsymbolic -o $@ $<
39
40 lib32/libGL.so.1: glaze-gl.c specs/gl.def
41         mkdir -p lib32
42         $(CC) $(GLAZE_CFLAGS) -m32 -fPIC -shared -Wl,-Bsymbolic -o $@ $<
43
44 .PHONY: install
45 install: all
46         mkdir -p $(DESTDIR)$(LIBDIR)/glaze/lib64
47         install -m0644 lib64/libGL.so.1 $(DESTDIR)$(LIBDIR)/glaze/lib64
48         mkdir -p $(DESTDIR)$(LIBDIR)/glaze/lib32
49         install -m0644 lib32/libGL.so.1 $(DESTDIR)$(LIBDIR)/glaze/lib32
50         install -m0644 $(LIBGLAZE_LIBNAME) $(DESTDIR)$(LIBDIR)
51         ln -sf $(LIBGLAZE_LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBGLAZE_SONAME)
52         ln -sf $(LIBGLAZE_LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBGLAZE_LINKER_NAME)
53         mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
54         install glaze.pc $(DESTDIR)$(LIBDIR)/pkgconfig
55         mkdir -p $(DESTDIR)$(INCLUDEDIR)/glaze
56         install -m0644 glaze.h $(DESTDIR)$(INCLUDEDIR)/glaze
57
58 clean:
59         rm -f $(TARGETS)