You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
678 B
24 lines
678 B
2 years ago
|
var CC: 'gcc'
|
||
|
var CFLAGS: '-Wall', '-Wextra', '-Werror'
|
||
|
var LDFLAGS: '-lm'
|
||
|
|
||
|
with public default target 'all'
|
||
|
\depends 'wren_aoc'
|
||
|
|
||
|
with public target 'wren_aoc'
|
||
|
\depends 'main.o', 'aoc.o', 'libwren.a'
|
||
|
\produces '%'
|
||
|
\fn => _.cmd CC, CFLAGS, @infiles, '-o', @outfile, LDFLAGS
|
||
|
|
||
|
with target {'main.o', 'aoc.o'}, pattern: '%.o'
|
||
|
\depends '%.c'
|
||
|
\produces '%.o'
|
||
|
\fn => _.cmd CC, CFLAGS, @infile, '-o', @outfile, '-c'
|
||
|
|
||
|
with target 'aoc.c'
|
||
|
\depends 'aoc.wren'
|
||
|
\produces '%'
|
||
|
\fn =>
|
||
|
code = _.readfile @infile
|
||
|
c_code = "extern const char* aoc_mod = \"#{code\gsub('"', '\\"')\gsub('\n', '\\n')}\";\n"
|
||
|
_.writefile @outfile, c_code
|