SOURCES = adding_and_deleting.c auxiliary.c check_for_external_changes_timeout.c context_menu.c drag_and_drop.c \
          editing.c find.c find_and_replace.c kickshaw.c load_menu.c save_menu.c selecting.c undo_redo_autosave.c \
          .gresource.c
OBJS    = ${SOURCES:.c=.o}
CFLAGS  = -O2 -pedantic -std=gnu11 -Wall -Wextra -Wmissing-prototypes `pkg-config gtk+-3.0 --cflags`
LDADD   = `pkg-config gtk+-3.0 --libs`
CC      = gcc
PACKAGE = kickshaw
PREFIX 	= /usr/local

all: ${OBJS}
	${CC} -o ${PACKAGE} ${OBJS} ${LDADD}

.c.o:
	${CC} ${CFLAGS} -c $<

clean:
	rm -f .*resource*.o *.o *.bak *~ kickshaw

install:
	mkdir -p /usr/share/locale
	cp -R resources/txts/translations/af /usr/share/locale/
	cp -R resources/txts/translations/az /usr/share/locale/
	cp -R resources/txts/translations/bn /usr/share/locale/
	cp -R resources/txts/translations/ca /usr/share/locale/
	cp -R resources/txts/translations/cs /usr/share/locale/
	cp -R resources/txts/translations/cy /usr/share/locale/
	cp -R resources/txts/translations/da /usr/share/locale/
	cp -R resources/txts/translations/de /usr/share/locale/
	cp -R resources/txts/translations/el /usr/share/locale/
	cp -R resources/txts/translations/es /usr/share/locale/
	cp -R resources/txts/translations/eu /usr/share/locale/
	cp -R resources/txts/translations/fi /usr/share/locale/
	cp -R resources/txts/translations/fr /usr/share/locale/
	cp -R resources/txts/translations/fy /usr/share/locale/
	cp -R resources/txts/translations/hi /usr/share/locale/
	cp -R resources/txts/translations/hr /usr/share/locale/
	cp -R resources/txts/translations/hu /usr/share/locale/
	cp -R resources/txts/translations/id /usr/share/locale/
	cp -R resources/txts/translations/is /usr/share/locale/
	cp -R resources/txts/translations/it /usr/share/locale/
	cp -R resources/txts/translations/ja /usr/share/locale/
	cp -R resources/txts/translations/ko /usr/share/locale/
	cp -R resources/txts/translations/lv /usr/share/locale/
	cp -R resources/txts/translations/mt /usr/share/locale/
	cp -R resources/txts/translations/nb /usr/share/locale/
	cp -R resources/txts/translations/nl /usr/share/locale/
	cp -R resources/txts/translations/pl /usr/share/locale/
	cp -R resources/txts/translations/pt /usr/share/locale/
	cp -R resources/txts/translations/ro /usr/share/locale/
	cp -R resources/txts/translations/ru /usr/share/locale/
	cp -R resources/txts/translations/sq /usr/share/locale/
	cp -R resources/txts/translations/sv /usr/share/locale/
	cp -R resources/txts/translations/tr /usr/share/locale/
	cp -R resources/txts/translations/vi /usr/share/locale/
	cp -R resources/txts/translations/zh_CN /usr/share/locale/
	cp -R resources/txts/translations/zh_HK /usr/share/locale/
	cp -R resources/txts/translations/zh_TW /usr/share/locale/
	cp kickshaw $(PREFIX)/bin

uninstall:
	rm $(PREFIX)/bin/kickshaw
	rm /usr/share/locale/af/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/az/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/bn/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/ca/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/cs/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/cy/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/da/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/de/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/el/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/es/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/eu/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/fi/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/fr/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/fy/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/hi/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/hr/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/hu/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/id/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/is/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/it/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/ja/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/ko/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/lv/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/mt/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/nb/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/nl/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/pl/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/pt/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/ro/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/ru/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/sq/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/sv/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/tr/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/vi/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/zh_CN/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/zh_HK/LC_MESSAGES/kickshaw.mo
	rm /usr/share/locale/zh_TW/LC_MESSAGES/kickshaw.mo
	@echo "For every user who has started Kickshaw a settings file .kickshawrc was created inside the respective home directory. It is not removed automatically, so it has to be removed manually."
