Makefile
author Stiletto <blasux@blasux.ru>
Wed, 24 Oct 2012 15:07:07 +0400
changeset 10 6b0d56b01ba0
parent 3 dd7a02c6d476
child 12 d3e36b368fc5
permissions -rw-r--r--
C generation
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
0
e27ed261417d Initial commit
Stiletto <blasux@blasux.ru>
parents:
diff changeset
     8
3
dd7a02c6d476 muc log, updated example config
Stiletto <blasux@blasux.ru>
parents: 1
diff changeset
     9
iswydt-bot: iswydt.vala config.vala muc.vala muc_log.vala
0
e27ed261417d Initial commit
Stiletto <blasux@blasux.ru>
parents:
diff changeset
    10
	$(VALAC) $(VFLAGS) $(VALALIBS) -o $@ $^
e27ed261417d Initial commit
Stiletto <blasux@blasux.ru>
parents:
diff changeset
    11
10
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    12
cfiles: iswydt.vala config.vala muc.vala muc_log.vala
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    13
	$(VALAC) $(VFLAGS) $(VALALIBS) -C $^
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    14
	mkdir -p cfiles
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    15
	mv *.c cfiles/
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    16
	cd cfiles
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    17
	echo 'LIBS := `pkg-config --libs $(LIBS)`' > cfiles/Makefile
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    18
	echo 'CFLAGS := `pkg-config --cflags $(LIBS)`' >> cfiles/Makefile
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    19
	echo "iswydt-bot: $(subst vala,c,$^)" >> cfiles/Makefile
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    20
	echo '	$$(CC) -o iswydt-bot $$(LIBS) $$(CFLAGS) $$^' >> cfiles/Makefile
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    21
6b0d56b01ba0 C generation
Stiletto <blasux@blasux.ru>
parents: 3
diff changeset
    22
.PHONY: cfiles