about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-08-25 20:04:42 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-08-25 20:04:42 +0000
commitc43a9ae78220daadd71e00fc0596ceb839621e28 (patch)
treef263485ed0a09b31afe38be42e151cf9fc1dad9c /Makefile
downloadlibfstab-c43a9ae78220daadd71e00fc0596ceb839621e28.tar.gz
libfstab-c43a9ae78220daadd71e00fc0596ceb839621e28.tar.xz
libfstab-c43a9ae78220daadd71e00fc0596ceb839621e28.zip
Initial commit. HEAD master
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..5a29d42
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,34 @@
+
+LIBDIR := /usr/lib
+INCLUDEDIR := /usr/include
+
+CC := gcc
+CFLAGS := -fPIC
+AR := ar
+RANLIB := ranlib
+INSTALL := install
+
+OBJS := fclose_keep_errno.o getfs_a.o getfsent.o getfsent_a.o
+
+it: include/fstab.h libfstab.a
+
+clean:
+	@exec rm -f *.o libfstab.a
+
+install: $(DESTDIR)$(INCLUDEDIR)/fstab.h $(DESTDIR)$(LIBDIR)/libfstab.a
+
+
+$(DESTDIR)$(INCLUDEDIR)/fstab.h: include/fstab.h
+	exec $(INSTALL) -D -m 644 $< $@
+
+$(DESTDIR)$(LIBDIR)/libfstab.a: libfstab.a
+	exec $(INSTALL) -D -m 644 $< $@
+
+%.o: src/%.c
+	exec $(CC) $(CFLAGS) -c -o $@ -I include -I src/include $<
+
+libfstab.a: $(OBJS)
+	exec $(AR) rc $@ $^
+	exec $(RANLIB) $@
+
+.PHONY: it clean install