From 9c5602e8c9cbd80e1396fe792b0591ca2b9d9432 Mon Sep 17 00:00:00 2001 From: CaioRS Date: Tue, 23 Jun 2015 21:32:06 -0300 Subject: [PATCH] Added Makefile and .gitignore --- .gitignore | 33 +++++++++++++++++++++++++++++++++ Makefile | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..642ec29 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +# Object files +*.o +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex +*.bin + +# Debug files +*.dSYM/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3404479 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +# +# +# +# +# +# +# +# +# +# +# +##################################################### + + +CC=gcc + +all: unit_test lib + +unit_test: + $(CC) -c slre.c + $(CC) -c unit_test.c + $(CC) -o unit_test.bin slre.o unit_test.o + @echo "Done. OK! run $ make test" + + +lib: + $(CC) -fPIC -g -c slre.c + $(CC) -shared -Wl,-soname,libslre.so -o libslre.so slre.o -lc + +test: + @echo "Running unit_test.bin" + ./unit_test.bin + +clean: + @rm -rf *.o *.bin *.out *.so