Makefile
author Stiletto <blasux@blasux.ru>
Mon, 05 Nov 2012 23:53:52 +0400
changeset 11 0f0cf428409f
parent 10 6b0d56b01ba0
child 12 d3e36b368fc5
permissions -rw-r--r--
Crappy reconnector

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