469,951 Members | 2,340 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

[ANN] pyKook 0.0.1 - a simple build tool similar to Make or Ant

Hi all,

I have released pyKook 0.0.1.
http://pypi.python.org/pypi/Kook/0.0.1
http://www.kuwata-lab.com/kook/
http://www.kuwata-lab.com/kook/pykook-users-guide.html

pyKook is a simple build tool similar to Make, Ant, Rake, or SCons.
pyKook regards software project as cooking.
Terms used in pyKook are cooking terms.
For example:

cookbook - Makefile
product - target file
ingredient - source file
recipe - how to create target from source
Cookbook (= Makefile) is written in pure Python.
You can write any statements or expressions in cookbook.
Example of cookbook (Kookbook.py):

--------------------------------------------------
##
## properties
##
cc = prop('cc', 'gcc')
cflags = prop('cflags', '-g -Wall')
##
## recipes
##
@ingreds("hello")
def task_all(c):
pass

@product("hello")
@ingreds("hello.o")
def file_command(c):
"""generates hello command"""
system(c%"$(cc) $(cflags) -o $(product) $(ingred)")

@product("*.o")
@ingreds("$(1).c", if_exists("$(1).h"))
def file_ext_o(c):
"""compile '*.c' and '*.h'"""
system(c%"$(cc) $(cflags) -c $(1).c")

def task_clean(c):
rm_f("*.o")
--------------------------------------------------
Exampe of result:

==================================================
shls
Kookbook.py hello.c hello.h

shpykook -l
Properties:
cc : 'gcc'
cflags : '-g -Wall'

Task recipes:
all : cook all products
clean : remove by-products

File recipes:
hello : generates hello command
*.o : compile '*.c' and '*.h'

(Tips: you can set 'kook_default_product' variable in your
kookbook.)

shpykook all # or, pykook --cc=gcc4 all
### *** hello.o (func=file_ext_o)
$ gcc -g -Wall -c hello.c
### ** hello (func=file_command)
$ gcc -g -Wall -o hello hello.o
### * all (func=task_all)
==================================================
See users-guide for more details.
http://www.kuwata-lab.com/kook/pykook-users-guide.html
Have fun!

--
regards,
makoto kuwata

Oct 19 '08 #1
0 871

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Hung Jung Lu | last post: by
reply views Thread by Fuzzyman | last post: by
8 posts views Thread by ted | last post: by
51 posts views Thread by Alan | last post: by
18 posts views Thread by Q. John Chen | last post: by
14 posts views Thread by Zed A. Shaw | last post: by
6 posts views Thread by Hussein B | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.