From e3244cc3a363dd336612a99bc98c192f247aa423 Mon Sep 17 00:00:00 2001 From: Mohamed Aslan Date: Sun, 20 Aug 2017 00:27:49 -0600 Subject: [PATCH] add a Makefile for gnu make --- Makefile.gnu | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Makefile.gnu diff --git a/Makefile.gnu b/Makefile.gnu new file mode 100644 index 0000000..c750ad4 --- /dev/null +++ b/Makefile.gnu @@ -0,0 +1,19 @@ +CFLAGS+= -Wall -I. -fPIC -g +LDFLAGS+= -L. -lbsd +SRCS=$(wildcard *.c) +OBJS=$(patsubst %.c, %.o, $(SRCS)) +all: hashtab.a hashtab.so example +%.o: %.c + $(CC) -o $@ -c $< $(CFLAGS) +hashtab.a: $(OBJS) + ar cq hashtab.a hashtab.o +hashtab.so: $(OBJS) + $(CC) -shared -o hashtab.so hashtab.o +example: hashtab.a + $(CC) example.o -o example -l:hashtab.a $(LDFLAGS) +install: hashtab.a hashtab.so + install -m 0644 hashtab.a /usr/lib/libhashtab.a + install -m 0644 hashtab.so /usr/lib/libhashtab.so + install -m 0644 hashtab.h /usr/include/ +clean: + rm -f *.o *.a *.so example -- 2.11.4.GIT