Browse Source

Basics

master
Stefan Bühler 11 years ago
parent
commit
fd3652089f
9 changed files with 83 additions and 1 deletions
  1. 8
    0
      .gitignore
  2. 1
    1
      icfp08/bin/package
  3. 19
    0
      ragel.py
  4. 2
    0
      src/control.c
  5. 6
    0
      src/control.h
  6. 4
    0
      src/main.c
  7. 16
    0
      src/wscript
  8. BIN
      waf
  9. 27
    0
      wscript

+ 8
- 0
.gitignore View File

@@ -0,0 +1,8 @@
.lock-wscript
.waf-*
Doxyfile
build
*.kdev*
*.pyc
*.o
*~

+ 1
- 1
icfp08/bin/package View File

@@ -35,4 +35,4 @@ if test "$non_comments" -eq 0 ; then
echo 'NOTE: There are no installation actions for your script'
fi

exit $status
exit $status

+ 19
- 0
ragel.py View 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
- 0
src/control.c View File

@@ -0,0 +1,2 @@
#include "control.h"


+ 6
- 0
src/control.h View File

@@ -0,0 +1,6 @@
#ifndef _CONTROL_H
#define _CONTROL_H



#endif

+ 4
- 0
src/main.c View File

@@ -0,0 +1,4 @@

int main(char **argv, int argc) {
return 0;
}

+ 16
- 0
src/wscript View 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 += ''

BIN
waf View File


+ 27
- 0
wscript View 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…
Cancel
Save