Basics
This commit is contained in:
parent
802a330059
commit
fd3652089f
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
.lock-wscript
|
||||
.waf-*
|
||||
Doxyfile
|
||||
build
|
||||
*.kdev*
|
||||
*.pyc
|
||||
*.o
|
||||
*~
|
19
ragel.py
Normal file
19
ragel.py
Normal file
@ -0,0 +1,19 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
# Thomas Nagy, 2006 (ita)
|
||||
|
||||
"Ragel: '.rl' files are converted into .c files using 'ragel': {.rl -> .c -> .o}"
|
||||
|
||||
import TaskGen
|
||||
|
||||
TaskGen.declare_chain(
|
||||
name = 'ragel',
|
||||
action = '${RAGEL} -o ${TGT} ${SRC}',
|
||||
ext_in = '.rl',
|
||||
ext_out = '.c',
|
||||
before = 'c',
|
||||
)
|
||||
|
||||
def detect(conf):
|
||||
dang = conf.find_program('ragel', var='RAGEL')
|
||||
if not dang: conf.fatal('cannot find the program "ragel"')
|
2
src/control.c
Normal file
2
src/control.c
Normal file
@ -0,0 +1,2 @@
|
||||
#include "control.h"
|
||||
|
6
src/control.h
Normal file
6
src/control.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef _CONTROL_H
|
||||
#define _CONTROL_H
|
||||
|
||||
|
||||
|
||||
#endif
|
4
src/main.c
Normal file
4
src/main.c
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
int main(char **argv, int argc) {
|
||||
return 0;
|
||||
}
|
16
src/wscript
Normal file
16
src/wscript
Normal file
@ -0,0 +1,16 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
# src/wscript
|
||||
|
||||
main_source = '''
|
||||
main.c
|
||||
control.c
|
||||
'''
|
||||
|
||||
def build(bld):
|
||||
main = bld.new_task_gen('cc', 'program')
|
||||
main.name = 'icfp08'
|
||||
main.source = main_source
|
||||
main.target = 'icfp08'
|
||||
main.uselib += ''
|
27
wscript
Normal file
27
wscript
Normal file
@ -0,0 +1,27 @@
|
||||
#! /usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
# wscript
|
||||
|
||||
VERSION='0.0.1'
|
||||
APPNAME='icfp08'
|
||||
|
||||
srcdir = '.'
|
||||
blddir = 'build'
|
||||
|
||||
def set_options(opt):
|
||||
opt.tool_options('compiler_cc')
|
||||
opt.tool_options('ragel', tdir = '.')
|
||||
|
||||
def configure(conf):
|
||||
conf.check_tool('compiler_cc')
|
||||
conf.check_tool('ragel', tooldir = '.')
|
||||
|
||||
common_ccflags = [
|
||||
'-std=gnu99', '-Wall', '-g', '-Wshadow', '-W', '-pedantic',
|
||||
# '-fPIC', '-D_GNU_SOURCE',
|
||||
]
|
||||
conf.env['CCFLAGS'] += common_ccflags
|
||||
|
||||
def build(bld):
|
||||
bld.add_subdirs('src')
|
Loading…
Reference in New Issue
Block a user