From 6e2f7c6ff11c25271f4660b182dbe9b71ac6cd3c Mon Sep 17 00:00:00 2001 From: Drutu Bogdan Date: Sat, 18 Dec 2010 15:25:46 +0200 Subject: [PATCH] Makefile & run script (run main and load swift.so) --- makefile | 23 +++++++++++++++++++++++ run.sh | 5 +++++ 2 files changed, 28 insertions(+) create mode 100644 makefile create mode 100755 run.sh diff --git a/makefile b/makefile new file mode 100644 index 0000000..71982b9 --- /dev/null +++ b/makefile @@ -0,0 +1,23 @@ +CC=gcc +CFLAGS=-g -Wall -fPIC +BIN=bin +SRC=src +LIB=lib + +ALL: directory lib main + +directory: + mkdir $(BIN) + mkdir $(LIB) + +lib: object + gcc -shared $(BIN)/lib_swift.o -o $(LIB)/libswift.so + +main: + gcc -Wall $(SRC)/main.c -o $(BIN)/main -lswift -L$(LIB) + +object: $(SRC)/lib_swift.c + $(CC) $(CFLAGS) -o $(BIN)/lib_swift.o -c $(SRC)/lib_swift.c + +clean: + rm -fr $(BIN) $(LIB) diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..e6e7140 --- /dev/null +++ b/run.sh @@ -0,0 +1,5 @@ +#/bin/bash + +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:lib + +./bin/main $* -- 2.20.1