project.janet (832B)
1 (declare-project 2 :name "instow") 3 4 (declare-binscript 5 :main "instow" 6 :hardcode-syspath true 7 :is-janet true) 8 9 (declare-native 10 :name "instow/native/nftw" 11 :source ["src/native/nftw.c" 12 "src/native/os.c"]) 13 14 (declare-source 15 :prefix "instow" 16 :source ["src/file.janet" 17 "src/main.janet" 18 "src/libc.janet" 19 "src/tools.janet" 20 "src/utils.janet"]) 21 22 (def linkpath "src/native/nftw.so") 23 (def buildpath (string/join [(os/getenv "PWD") "/build/instow/native/nftw.so"])) 24 (def linkto (try (os/readlink linkpath) ([e f] nil))) 25 26 (if (not= linkto buildpath ) 27 (do 28 (if (not (nil? linkto)) (os/rm linkpath)) 29 (os/symlink buildpath linkpath))) 30 31 (let [file (file/open "compile_flags.txt" :w)] 32 (file/write file "-I" (os/getenv "HOME") "/.usr/local/include\n") 33 (file/close file))