logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

gen.lua (3656B)


  1. cflags{
  2. '-std=c99', '-Wall', '-Wpedantic',
  3. '-Wno-discarded-qualifiers',
  4. '-D _GNU_SOURCE',
  5. '-I $srcdir',
  6. '-I $srcdir/include',
  7. '-I $dir',
  8. }
  9. pkg.deps = {}
  10. local cfg = {}
  11. for line in iterlines('config.h', 1) do
  12. local var = line:match('^#define (WITH_[%w_]+)')
  13. if var then
  14. cfg[var] = true
  15. end
  16. end
  17. local srcs = paths[[
  18. lib/sqfs/(
  19. id_table.c super.c
  20. readdir.c xattr/xattr.c
  21. write_table.c meta_writer.c
  22. read_super.c meta_reader.c
  23. read_inode.c write_inode.c
  24. dir_writer.c xattr/xattr_reader.c
  25. read_table.c comp/compressor.c
  26. dir_reader.c read_tree.c
  27. inode.c xattr/xattr_writer.c
  28. xattr/xattr_writer_flush.c
  29. xattr/xattr_writer_record.c
  30. write_super.c data_reader.c
  31. block_processor/frontend.c
  32. block_processor/block_processor.c
  33. block_processor/backend.c
  34. frag_table.c
  35. block_writer.c
  36. misc.c
  37. unix/io_file.c
  38. )
  39. lib/util/threadpool.c
  40. libutil.a
  41. ]]
  42. if cfg.WITH_GZIP then
  43. cflags{'-isystem $builddir/pkg/zlib/include'}
  44. table.insert(pkg.deps, 'pkg/zlib/headers')
  45. table.insert(srcs, {
  46. 'lib/sqfs/comp/gzip.c',
  47. '$builddir/pkg/zlib/libz.a',
  48. })
  49. end
  50. if cfg.WITH_ZSTD then
  51. cflags{'-isystem $builddir/pkg/zstd/include'}
  52. table.insert(pkg.deps, 'pkg/zstd/headers')
  53. table.insert(srcs, {
  54. 'lib/sqfs/comp/zstd.c',
  55. '$builddir/pkg/zstd/libzstd.a',
  56. })
  57. end
  58. lib('libsquashfs.a', srcs)
  59. lib('libcommon.a', [[
  60. lib/common/(
  61. inode_stat.c hardlink.c
  62. print_version.c data_reader_dump.c
  63. compress.c comp_opt.c
  64. data_writer.c
  65. get_path.c data_writer_ostream.c
  66. perror.c
  67. mkdir_p.c parse_size.c
  68. print_size.c
  69. writer/(
  70. init.c cleanup.c
  71. serialize_fstree.c
  72. finish.c
  73. )
  74. )
  75. libsquashfs.a.d
  76. libfstream.a
  77. libfstree.a.d
  78. ]])
  79. lib('libfstream.a', [[
  80. lib/fstream/(
  81. ostream.c printf.c
  82. istream.c get_line.c
  83. compressor.c
  84. compress/(
  85. ostream_compressor.c
  86. gzip.c
  87. zstd.c
  88. )
  89. uncompress/(
  90. istream_compressor.c
  91. autodetect.c
  92. gzip.c
  93. zstd.c
  94. )
  95. unix/(ostream.c istream.c)
  96. )
  97. ]])
  98. lib('libfstree.a', [[
  99. lib/fstree/(
  100. fstree.c fstree_from_file.c
  101. fstree_sort.c hardlink.c
  102. post_process.c get_path.c
  103. mknode.c fstree_from_dir.c
  104. add_by_path.c get_by_path.c
  105. source_date_epoch.c
  106. canonicalize_name.c
  107. filename_sane.c
  108. )
  109. libfstream.a
  110. ]])
  111. lib('libtar.a', [[
  112. lib/tar/(
  113. read_header.c write_header.c
  114. number.c checksum.c cleanup.c
  115. read_sparse_map.c read_sparse_map_old.c
  116. base64.c urldecode.c
  117. padd_file.c record_to_memory.c
  118. pax_header.c read_sparse_map_new.c
  119. )
  120. ]])
  121. lib('libutil.a', [[
  122. lib/util/(
  123. str_table.c alloc.c
  124. rbtree.c
  125. array.c
  126. xxhash.c hash_table.c
  127. threadpool_serial.c
  128. is_memory_zero.c
  129. )
  130. ]])
  131. exe('gensquashfs', [[
  132. bin/gensquashfs/(mkfs.c options.c selinux.c dirscan_xattr.c)
  133. libcommon.a.d
  134. ]])
  135. file('bin/gensquashfs', '755', '$outdir/gensquashfs')
  136. man{'bin/gensquashfs/gensquashfs.1'}
  137. exe('rdsquashfs', [[
  138. bin/rdsquashfs/(
  139. rdsquashfs.c
  140. list_files.c options.c
  141. restore_fstree.c describe.c
  142. fill_files.c dump_xattrs.c
  143. stat.c
  144. )
  145. libcommon.a.d
  146. ]])
  147. file('bin/rdsquashfs', '755', '$outdir/rdsquashfs')
  148. man{'bin/rdsquashfs/rdsquashfs.1'}
  149. exe('sqfsdiff', [[
  150. bin/sqfsdiff/(
  151. sqfsdiff.c
  152. util.c options.c
  153. compare_dir.c node_compare.c
  154. compare_files.c super.c
  155. extract.c
  156. )
  157. libcommon.a.d
  158. ]])
  159. file('bin/sqfsdiff', '755', '$outdir/sqfsdiff')
  160. man{'bin/sqfsdiff/sqfsdiff.1'}
  161. exe('sqfs2tar', [[
  162. bin/sqfs2tar/(sqfs2tar.c options.c write_tree.c xattr.c)
  163. libcommon.a.d libtar.a
  164. ]])
  165. file('bin/sqfs2tar', '755', '$outdir/sqfs2tar')
  166. man{'bin/sqfs2tar/sqfs2tar.1'}
  167. exe('tar2sqfs', [[
  168. bin/tar2sqfs/(tar2sqfs.c options.c process_tarball.c)
  169. libcommon.a.d libtar.a
  170. ]])
  171. file('bin/tar2sqfs', '755', '$outdir/tar2sqfs')
  172. man{'bin/tar2sqfs/tar2sqfs.1'}
  173. fetch 'git'