add anoia.net.constants for SOCK_{STREAM,DGRAM} etc

we use an ugly bit of C preprocessor to get the values from
header files, because certain constants are different on MIPS
than on other architectures
This commit is contained in:
Daniel Barlow
2024-04-26 16:43:09 +01:00
parent 9795f03da4
commit 74cf3e0711
3 changed files with 19 additions and 3 deletions

View File

@@ -1,10 +1,14 @@
default: fs.lua init.lua nl.lua svc.lua
default: fs.lua init.lua nl.lua svc.lua net/constants.lua
test:
ln -s . anoia
fennel test.fnl
fennel test-svc.fnl
net/constants.lua: net/constants.c
$(CC) -imacros sys/socket.h -imacros linux/netlink.h -E -P - < net/constants.c | sed 's/ *$$//g' | cat -s > net/constants.lua
%.lua: %.fnl
fennel --compile $< > $@