.PHONY: all clean test

GTK_CFLAGS=$(shell pkg-config --cflags gtk+-2.0)
GTK_LIBS=$(shell pkg-config --libs gtk+-2.0)

DEBUG=-O0 -g
CFLAGS=$(GTK_CFLAGS) $(DEBUG)
LIBS=$(GTK_LIBS)

all: mdview

mdview: *.c *.h
	gcc *.c -o mdview $(CFLAGS) $(LIBS)
	
clean:
	rm -f mdview

test: all
	./mdview examples 

### build distribution package
package: clean
	-rm -rf /tmp/mdview-fossil
	-mkdir -p /tmp/mdview-fossil
	-cp  -a * /tmp/mdview-fossil
	-fossil info > /tmp/mdview-fossil/fossil-version
	-echo Version $(shell date +%F) > /tmp/mdview-fossil/VERSION
	-rm -f /tmp/mdview-fossil/auth*
	-tar -C /tmp -cjvf ../mdview-$(shell date +%F).tar.bz2 mdview-fossil
	-rm -rf /tmp/mdview-fossil

