11
22darwin .silverchain .generate ({
33 src = " src" ,
4- project_short_cut = " doTHeWorld" ,
5- tags = { " macros" , " consts" , " types" , " globals" , " fdeclare" , " fdefine" }
6- })
4+ project_short_cut = " CArgvParse" ,
5+ tags = { " macros" , " types" , " fdeclare" , " globals" , " fdefine" }
6+ })
7+
8+ local MAX_CONNTENT = darwin .camalgamator .ONE_MB * 20
9+ local MAX_RECURSION = 100
10+
11+ local lincense = " /* " .. darwin .dtw .load_file (" LICENSE" ) .. " */ \n "
12+
13+ local onefile = darwin .camalgamator .generate_amalgamation (" src/one.c" , MAX_CONNTENT , MAX_RECURSION )
14+ onefile = lincense .. onefile
15+
16+ darwin .dtw .write_file (" release/CArgvParseOne.c" , onefile )
17+
18+ local only_declare = darwin .camalgamator .generate_amalgamation (" src/imports/imports.fdeclare.h" , MAX_CONNTENT ,
19+ MAX_RECURSION )
20+ only_declare = lincense .. only_declare
21+ darwin .dtw .write_file (" release/CArgvParse.h" , only_declare )
22+
23+
24+
25+ local only_definition = darwin .camalgamator .generate_amalgamation_with_callback (" src/imports/imports.fdefine.h" ,
26+ function (import , path )
27+ if import == " src/imports/imports.fdeclare.h" then
28+ return " dont-include"
29+ end
30+
31+ return " include-once"
32+ end ,
33+
34+ MAX_CONNTENT ,
35+ MAX_RECURSION
36+ )
37+
38+ only_definition = ' #include "CArgvParse.h"\n ' .. only_definition
39+
40+ only_definition = lincense .. only_definition
41+
42+ darwin .dtw .write_file (" release/CArgvParse.c" , only_definition )
43+
44+ os.execute (" zip -r release/CArgvParse.zip dependencies src build" )
0 commit comments