summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2022-10-29 13:37:41 -0400
committerCara Salter <cara@devcara.com>2022-10-29 13:37:41 -0400
commit9f6108784ceb997ce388e5212d36ed86ad3934df (patch)
treed0a38b3a8935333ee12cd4b893a64806412b084b /Makefile
downloadclog-9f6108784ceb997ce388e5212d36ed86ad3934df.tar.gz
clog-9f6108784ceb997ce388e5212d36ed86ad3934df.zip
Initial commit
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
+