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) TARGETS = glenv libglenv.so all: $(TARGETS) GLENV_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(GLAZE_CFLAGS) GLENV_LDFLAGS = $(GLAZE_LDFLAGS) glenv: glenv.c $(CC) $(GLENV_CFLAGS) $(GLENV_LDFLAGS) -o $@ $< libglenv.so: glwrap.c $(CC) $(GLENV_CFLAGS) $(GLENV_LDFLAGS) -fPIC -shared -Wl,-Bsymbolic -o $@ $< .PHONY: install install: all mkdir -p $(DESTDIR)$(BINDIR) install -m07555 glenv $(DESTDIR)$(BINDIR) mkdir -p $(DESTDIR)$(LIBDIR) install -m0644 libglenv.so $(DESTDIR)$(LIBDIR) clean: rm -f $(TARGETS)