]> git.cworth.org Git - glaze/blobdiff - Makefile
Add a new libglaze library
[glaze] / Makefile
index 3ccb7fa3d94772a059b42f0510e0085aea86e7f8..069192afe1f76bb048cdb858b8c23c0becfa69d6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,30 @@
-LIBGLAZE_VERSION_MAJOR   = 0
-LIBGLAZE_VERSION_MINOR   = 0
-LIBGLAZE_VERSION_RELEASE = 0
+all:
+
+# Get settings from the output of configure by running it to generate
+# Makefile.config if it doesn't exist yet.
+
+# If Makefile.config doesn't exist, then srcdir won't be
+# set. Conditionally set it (assuming a plain srcdir build) so that
+# the rule to generate Makefile.config can actually work.
+srcdir ?= .
+
+include Makefile.config
+Makefile.config: $(srcdir)/configure
+ifeq ($(configure_options),)
+       @echo ""
+       @echo "Note: Calling ./configure with no command-line arguments. This is often fine,"
+       @echo "      but if you want to specify any arguments (such as an alternate prefix"
+       @echo "      into which to install), call ./configure explicitly and then make again."
+       @echo "      See \"./configure --help\" for more details."
+       @echo ""
+endif
+       $(srcdir)/configure $(configure_options)
 
 LIBGLAZE_LINKER_NAME = libglaze.so
-LIBGLAZE_SONAME = $(LIBGLAZE_LINKER_NAME).$(LIBGLAZE_VERSION_MAJOR)
-LIBGLAZE_LIBNAME = $(LIBGLAZE_SONAME).$(LIBGLAZE_VERSION_MINOR).$(LIBGLAZE_VERSION_RELEASE)
+LIBGLAZE_SONAME = $(LIBGLAZE_LINKER_NAME).$(MAJOR)
+LIBGLAZE_LIBNAME = $(LIBGLAZE_SONAME).$(MINOR).$(RELEASE)
 
-TARGETS = lib64/libGL.so.1 lib32/libGL.so.1
+TARGETS = $(LIBGLAZE_LIBNAME) lib64/libGL.so.1 lib32/libGL.so.1
 
 all: $(TARGETS)
 
@@ -27,26 +45,13 @@ install: all
        install -m0644 lib64/libGL.so.1 $(DESTDIR)$(LIBDIR)/glaze/lib64
        mkdir -p $(DESTDIR)$(LIBDIR)/glaze/lib32
        install -m0644 lib32/libGL.so.1 $(DESTDIR)$(LIBDIR)/glaze/lib32
+       install -m0644 $(LIBGLAZE_LIBNAME) $(DESTDIR)$(LIBDIR)
+       ln -sf $(LIBGLAZE_LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBGLAZE_SONAME)
+       ln -sf $(LIBGLAZE_LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBGLAZE_LINKER_NAME)
+       mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
+       install glaze.pc $(DESTDIR)$(LIBDIR)/pkgconfig
+       mkdir -p $(DESTDIR)$(INCLUDEDIR)/glaze
+       install -m0644 glaze.h $(DESTDIR)$(INCLUDEDIR)/glaze
 
 clean:
        rm -f $(TARGETS)
-
-# Get settings from the output of configure by running it to generate
-# Makefile.config if it doesn't exist yet.
-
-# If Makefile.config doesn't exist, then srcdir won't be
-# set. Conditionally set it (assuming a plain srcdir build) so that
-# the rule to generate Makefile.config can actually work.
-srcdir ?= .
-
-include Makefile.config
-Makefile.config: $(srcdir)/configure
-ifeq ($(configure_options),)
-       @echo ""
-       @echo "Note: Calling ./configure with no command-line arguments. This is often fine,"
-       @echo "      but if you want to specify any arguments (such as an alternate prefix"
-       @echo "      into which to install), call ./configure explicitly and then make again."
-       @echo "      See \"./configure --help\" for more details."
-       @echo ""
-endif
-       $(srcdir)/configure $(configure_options)