all: iswydt-bot
VALAC = valac
LIBS := gee-1.0 loudmouth-1.0
VALAONLYLIBS := posix
VALALIBS := $(patsubst %, --pkg %, $(LIBS) $(VALAONLYLIBS))
VFLAGS = -g
iswydt-bot: iswydt.vala config.vala muc.vala muc_log.vala
$(VALAC) $(VFLAGS) $(VALALIBS) -o $@ $^
cfiles: iswydt.vala config.vala muc.vala muc_log.vala
$(VALAC) $(VFLAGS) $(VALALIBS) -C $^
mkdir -p cfiles
mv *.c cfiles/
cd cfiles
echo 'LIBS := `pkg-config --libs $(LIBS)`' > cfiles/Makefile
echo 'CFLAGS := `pkg-config --cflags $(LIBS)`' >> cfiles/Makefile
echo "iswydt-bot: $(subst vala,c,$^)" >> cfiles/Makefile
echo ' $$(CC) -o iswydt-bot $$(LIBS) $$(CFLAGS) $$^' >> cfiles/Makefile
.PHONY: cfiles