working named pipe and pipe simple with c and golang

This commit is contained in:
talksik
2023-11-21 09:11:47 -08:00
commit 61a43bd732
10 changed files with 178 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
.PHONY: all clean test pipe named-pipe
.ONESHELL:
all: clean
echo "going to run all ipc/ffi examples"
sleep 1;
make test;
make pipe;
test:
mkdir -p test;
cd test;
pwd;
cd ..;
# note: below line stays in root dir because no `\` at the end of previous line
rm -rf test;
pipe:
cd pipe;
gcc test_pipe.c -o test_pipe_c_program;
go build -o test_pipe_go_program main.go;
./test_pipe_go_program
named-pipe:
cd named_pipe;
gcc test_named_pipe_receiver.c -o test_named_pipe_receiver_c_program;
go build -o test_named_pipe_sender_go_program main.go;
./test_named_pipe_receiver_c_program & ./test_named_pipe_sender_go_program;
clean:
echo "cleaning..."
rm -rf pipe/test_pipe_c_program pipe/test_pipe_go_program
rm -rf named_pipe/test_named_pipe_receiver_c_program named_pipe/test_named_pipe_sender_go_program