commit 6ad47845ab722a9140c0977610fc22248ad620a7 Author: Annwan Date: Wed Aug 30 19:48:45 2023 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9955bdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/*.o +/nc + diff --git a/Build.moon b/Build.moon new file mode 100644 index 0000000..16bff7d --- /dev/null +++ b/Build.moon @@ -0,0 +1,40 @@ +public var NAME: 'out' + +-- programs +var CC: 'gcc' +var LD: 'gcc' +var RM: 'rm', '-f', '--' + +-- libs +var LIBS: {} + +-- flags +var CFLAGS: '-Wall', '-Wextra', '-Werror', (LIBS[1] and (_.pkgconfig.cflags LIBS) or {}) +var LDFLAGS: LIBS[1] and (_.pkgconfig.libs LIBS) or {} + +-- files +var C_SOURCES: _.wildcard 'src/**.c' +var C_OBJECTS: _.patsubst C_SOURCES, 'src/%.c', 'build/%.o' +var BINARY: NAME + +with public default target 'all' + \depends BINARY + +with public target 'clean' + \fn => _.cmd RM, C_OBJECTS + +with public target 'deepclean' + \after 'clean' + \fn => _.cmd RM, BINARY + +with target BINARY + \depends C_OBJECTS + \produces BINARY + \fn => _.cmd LD, '-o', @outfile, @infiles, LDFLAGS + +with target C_OBJECTS, pattern: 'build/%.o' + \mkdirs! + \depends 'src/%.c' + \depends => _.cdeps[CC] @infile, CFLAGS + \produces 'build/%.o' + \fn => _.cmd CC, CFLAGS, '-c', @infile, '-o', @outfile diff --git a/README b/README new file mode 100644 index 0000000..e69de29