X-Git-Url: https://git.cworth.org/git?p=glaze;a=blobdiff_plain;f=Makefile;h=3ccb7fa3d94772a059b42f0510e0085aea86e7f8;hp=c9db5c8f7a18300d037c542b54b7d689376d825e;hb=0b190cc8fbca0f970eadd8c0f1d5792c41f71cf6;hpb=d6e3c2ecec2d78a1f07f1701a472d646d3165f71 diff --git a/Makefile b/Makefile index c9db5c8..3ccb7fa 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,18 @@ -CC ?= gcc -CFLAGS ?= -g -CFLAGS += -Wall -Wextra -Wmissing-declarations -Werror=attributes +LIBGLAZE_VERSION_MAJOR = 0 +LIBGLAZE_VERSION_MINOR = 0 +LIBGLAZE_VERSION_RELEASE = 0 + +LIBGLAZE_LINKER_NAME = libglaze.so +LIBGLAZE_SONAME = $(LIBGLAZE_LINKER_NAME).$(LIBGLAZE_VERSION_MAJOR) +LIBGLAZE_LIBNAME = $(LIBGLAZE_SONAME).$(LIBGLAZE_VERSION_MINOR).$(LIBGLAZE_VERSION_RELEASE) TARGETS = lib64/libGL.so.1 lib32/libGL.so.1 all: $(TARGETS) +$(LIBGLAZE_LIBNAME): glaze.c + $(CC) $(CFLAGS) -fPIC -shared -Wl,-Bsymbolic,-soname=$(LIBGLAZE_SONAME) -o $@ $< + lib64/libGL.so.1: glaze-gl.c glapi.def mkdir -p lib64 $(CC) $(CFLAGS) -m64 -fPIC -shared -Wl,-Bsymbolic -o $@ $< @@ -14,5 +21,32 @@ lib32/libGL.so.1: glaze-gl.c specs/gl.def mkdir -p lib32 $(CC) $(CFLAGS) -m32 -fPIC -shared -Wl,-Bsymbolic -o $@ $< +.PHONY: install +install: all + mkdir -p $(DESTDIR)$(LIBDIR)/glaze/lib64 + 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 + 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)