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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e27ed261417d Initial commit
Stiletto <blasux@blasux.ru>
parents:
diff changeset
     1
all: iswydt-bot
e27ed261417d Initial commit
Stiletto <blasux@blasux.ru>
parents:
diff changeset
     2
e27ed261417d Initial commit
Stiletto <blasux@blasux.ru>
parents:
diff changeset
     3
VALAC = valac
10
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
     4
LIBS      := gee-1.0 loudmouth-1.0
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
     5
VALAONLYLIBS := posix
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
     6
VALALIBS  := $(patsubst %, --pkg %, $(LIBS) $(VALAONLYLIBS))
3
dd7a02c6d476 muc log, updated example config
Stiletto <blasux@blasux.ru>
parents: 1
diff changeset
     7
VFLAGS = -g
12
d3e36b368fc5 iq, commands, makefile up
Stiletto <blasux@blasux.ru>
parents: 10
diff changeset
     8
SOURCES = iswydt.vala config.vala simple_iq.vala muc.vala muc_log.vala muc_commands.vala version.vala
0
e27ed261417d Initial commit
Stiletto <blasux@blasux.ru>
parents:
diff changeset
     9
12
d3e36b368fc5 iq, commands, makefile up
Stiletto <blasux@blasux.ru>
parents: 10
diff changeset
    10
version.vala: .
d3e36b368fc5 iq, commands, makefile up
Stiletto <blasux@blasux.ru>
parents: 10
diff changeset
    11
	echo "static const string IswydtVersion = \"$$(hg id -bnit)\";" > version.vala
d3e36b368fc5 iq, commands, makefile up
Stiletto <blasux@blasux.ru>
parents: 10
diff changeset
    12
iswydt-bot: $(SOURCES)
0
e27ed261417d Initial commit
Stiletto <blasux@blasux.ru>
parents:
diff changeset
    13
	$(VALAC) $(VFLAGS) $(VALALIBS) -o $@ $^
e27ed261417d Initial commit
Stiletto <blasux@blasux.ru>
parents:
diff changeset
    14
12
d3e36b368fc5 iq, commands, makefile up
Stiletto <blasux@blasux.ru>
parents: 10
diff changeset
    15
cfiles: $(SOURCES) 
10
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    16
	$(VALAC) $(VFLAGS) $(VALALIBS) -C $^
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    17
	mkdir -p cfiles
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    18
	mv *.c cfiles/
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    19
	cd cfiles
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    20
	echo 'LIBS := `pkg-config --libs $(LIBS)`' > cfiles/Makefile
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    21
	echo 'CFLAGS := `pkg-config --cflags $(LIBS)`' >> cfiles/Makefile
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    22
	echo "iswydt-bot: $(subst vala,c,$^)" >> cfiles/Makefile
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    23
	echo '	$$(CC) -o iswydt-bot $$(LIBS) $$(CFLAGS) $$^' >> cfiles/Makefile
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    24
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    25
.PHONY: cfiles