summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..44dd1d4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,30 @@
+CC=gcc
+CFLAGS=-I. -Wall -fPIC
+MAJOR=0
+MINOR=1
+VERSION=$(MAJOR).$(MINOR)
+NAME=clog
+DESTDIR?=/usr/local/lib
+
+LFLAGS=
+
+%.o: %.c
+ $(CC) -c -o $@ $< $(CFLAGS)
+
+lib: lib$(NAME).so.$(VERSION)
+
+lib$(NAME).so:
+ ldconfig -v -n
+ ln -s lib$(NAME).so.$(MAJOR) lib$(NAME).so
+
+lib$(NAME).so.$(VERSION): $(NAME).o
+ $(CC) -shared $^ -o $@
+
+install: lib
+ install -Dm644 lib$(NAME).so.$(VERSION) $(DESTDIR)
+ install -Dm644 $(NAME).h /usr/include/
+
+clean:
+ rm -f lib$(NAME)*
+ rm -f src/*.o
+