Makefile
author Stiletto <blasux@blasux.ru>
Mon, 05 Nov 2012 23:54:44 +0400
changeset 12 d3e36b368fc5
parent 10 6b0d56b01ba0
permissions -rw-r--r--
iq, commands, makefile up

all: iswydt-bot

VALAC = valac
LIBS      := gee-1.0 loudmouth-1.0
VALAONLYLIBS := posix
VALALIBS  := $(patsubst %, --pkg %, $(LIBS) $(VALAONLYLIBS))
VFLAGS = -g
SOURCES = iswydt.vala config.vala simple_iq.vala muc.vala muc_log.vala muc_commands.vala version.vala

version.vala: .
	echo "static const string IswydtVersion = \"$$(hg id -bnit)\";" > version.vala
iswydt-bot: $(SOURCES)
	$(VALAC) $(VFLAGS) $(VALALIBS) -o $@ $^

cfiles: $(SOURCES) 
	$(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