AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I $(top_srcdir)/src/m4
AM_CPPFLAGS = -I$(top_srcdir)/src -fopenmp -I/usr/local/include/ImageMagick
EXTRA_DIST =

extradir=$(libdir)/pix2jpg

extra_LTLIBRARIES = pix2jpg.la
 
dist_extra_DATA  = LICENSE.txt
dist_extra_DATA += pix2jpg-help.pd

## some default flags
pix2jpg_la_CXXFLAGS = -fopenmp -I/usr/include/ImageMagick
pix2jpg_la_LDFLAGS  = -lMagick++ -lMagickCore -module -avoid-version -shared -shrext .@GEM_RTE_EXTENSION@
pix2jpg_la_LIBADD   = -lMagickCore

# RTE flags
pix2jpg_la_CXXFLAGS += @GEM_RTE_CFLAGS@ @GEM_ARCH_CXXFLAGS@
pix2jpg_la_LIBADD   += @GEM_RTE_LIBS@

pix2jpg_la_LDFLAGS += @GEM_ARCH_LDFLAGS@

# special flags for building externals
pix2jpg_la_CXXFLAGS += -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -pthread .@GEM_EXTERNAL_CFLAGS@
pix2jpg_la_LIBADD += -L$(top_builddir) @GEM_EXTERNAL_LIBS@

# convenience symlinks
## uha, this is ugly
pix2jpg.@GEM_RTE_EXTENSION@: pix2jpg.la
	rm -f $@
	test -f .libs/$@ && $(LN_S) .libs/$@ $@ || true

.PHONY: clean-conviencesymlink

clean-conviencesymlink:
	rm -f pix2jpg.@GEM_RTE_EXTENSION@

all-local:: pix2jpg.@GEM_RTE_EXTENSION@

clean-local:: clean-conviencesymlink


### SOURCES
pix2jpg_la_SOURCES = \
	pix2jpg.cpp \
	pix2jpg.h

