about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
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