# -*- makefile -*-


CXX := g++
CXXFLAGS := -I/usr/include/OpenEXR -pthread -I/usr/include/Imath  -g -O2 -ffile-prefix-map=/build/reproducible-path/enblend-enfuse-4.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -pipe -O2 -DNDEBUG -fopenmp -fpic
LD := $(CXX)
LDFLAGS := -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -shared


SOURCES := linear.cc fixed_power.cc templated_power.cc variable_power.cc sinc.cc
OBJECTS := $(patsubst %.cc,%.o,$(SOURCES))
SHARED_OBJECTS := $(patsubst %.cc,%.so,$(SOURCES))


.PHONY: all
all: $(SHARED_OBJECTS)


.PHONY: clean
clean:
	$(RM) *.so *.o


.PHONY: distclean
distclean: clean
	$(RM) *~


%.so: %.o
	$(LD) $(LDFLAGS) -Wl,-soname,$@ -o $@ $^


%.o: %.cc
	$(CXX) $(CXXFLAGS) -c $<


# All-in-one library
userweights.so: $(OBJECTS)


sinc.o: sinc.cc root_finding.hh


# User-weight `tabular' is not part of SOURCES, because it relies on a
# GSL header, which may not available on every system.
tabular.so: tabular.o interpolator.o
tabular.o: tabular.cc interpolator.hh

interpolator.cc: interpolator.hh
