X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=Makefile;h=f13fa877014873e702595377520cf90bd714c649;hb=f2c5ebbfe53ee598aa2b354f0e013aba3a10fffc;hp=3ccb7fa3d94772a059b42f0510e0085aea86e7f8;hpb=0b190cc8fbca0f970eadd8c0f1d5792c41f71cf6;p=glaze diff --git a/Makefile b/Makefile index 3ccb7fa..f13fa87 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,53 @@ -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) + +ifeq ($(COMPILER_SUPPORTS_32),Yes) +TARGETS += lib32/libGL.so.1 +endif + +ifeq ($(COMPILER_SUPPORTS_64),Yes) +TARGETS += lib64/libGL.so.1 +endif all: $(TARGETS) +GLAZE_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) + $(LIBGLAZE_LIBNAME): glaze.c - $(CC) $(CFLAGS) -fPIC -shared -Wl,-Bsymbolic,-soname=$(LIBGLAZE_SONAME) -o $@ $< + $(CC) $(GLAZE_CFLAGS) -fPIC -shared -Wl,-Bsymbolic,-soname=$(LIBGLAZE_SONAME) -ldl -o $@ $< lib64/libGL.so.1: glaze-gl.c glapi.def mkdir -p lib64 - $(CC) $(CFLAGS) -m64 -fPIC -shared -Wl,-Bsymbolic -o $@ $< + $(CC) $(GLAZE_CFLAGS) -m64 -fPIC -shared -Wl,-Bsymbolic -o $@ $< lib32/libGL.so.1: glaze-gl.c specs/gl.def mkdir -p lib32 - $(CC) $(CFLAGS) -m32 -fPIC -shared -Wl,-Bsymbolic -o $@ $< + $(CC) $(GLAZE_CFLAGS) -m32 -fPIC -shared -Wl,-Bsymbolic -o $@ $< .PHONY: install install: all @@ -27,26 +55,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)