about summary refs log tree commit diff
path: root/Makefile
blob: 5a29d4262b8b26720eb811d54ed82f80963174ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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