Blame Makefile

Packit c948fe
VERSION = 0.6
Packit c948fe
PREFIX = /usr/local
Packit c948fe
CFLAGS = -Wall -g -I. -O3 -funroll-loops -finline-limit=9999999 -ffast-math -malign-double -march=`uname -m` -fPIC
Packit c948fe
Packit c948fe
TARDIR = libgdither-$(VERSION)
Packit c948fe
Packit c948fe
all: libgdither.so
Packit c948fe
Packit c948fe
gdither.o: gdither.c gdither.h gdither_types_internal.h
Packit c948fe
	$(CC) $(CFLAGS) -c gdither.c
Packit c948fe
Packit c948fe
libgdither.so: gdither.o
Packit c948fe
	$(CC) -shared gdither.o -o libgdither.so
Packit c948fe
Packit c948fe
libgdither.pc: libgdither.pc.in Makefile
Packit c948fe
	sed -e 's|@VERSION@|$(VERSION)|' -e 's|@PREFIX@|$(PREFIX)|' \
Packit c948fe
		libgdither.pc.in > libgdither.pc
Packit c948fe
Packit c948fe
install: all
Packit c948fe
	install -d $(PREFIX)/lib/
Packit c948fe
	install libgdither.so $(PREFIX)/lib/
Packit c948fe
	install -d $(PREFIX)/include/
Packit c948fe
	install gdither.h $(PREFIX)/include/
Packit c948fe
	install gdither_types.h $(PREFIX)/include/
Packit c948fe
	install -d $(PREFIX)/lib/pkgconfig/
Packit c948fe
	install libgdither.pc $(PREFIX)/lib/pkgconfig/
Packit c948fe
Packit c948fe
clean:
Packit c948fe
	rm -f *.o *.so
Packit c948fe
	(cd tests && make clean)
Packit c948fe
	(cd examples && make clean)
Packit c948fe
Packit c948fe
dist: all libgdither.pc
Packit c948fe
	rm -rf $(TARDIR)
Packit c948fe
	mkdir -p $(TARDIR)/tests $(TARDIR)/examples
Packit c948fe
	cp README COPYING Makefile *.c *.h libgdither.pc \
Packit c948fe
		$(TARDIR)
Packit c948fe
	cp tests/Makefile tests/*.[ch] tests/*.cc \
Packit c948fe
		$(TARDIR)/tests/ 
Packit c948fe
	cp examples/Makefile examples/*.[ch] \
Packit c948fe
		$(TARDIR)/examples/ 
Packit c948fe
	(cd $(TARDIR) && make test clean)
Packit c948fe
	tar cfz $(TARDIR).tar.gz $(TARDIR)
Packit c948fe
	@rm -rf $(TARDIR)
Packit c948fe
Packit c948fe
test: all
Packit c948fe
	(cd tests && make test)