2 BINDIR ?
= $(PREFIX
)/bin
3 MANDIR ?
= $(PREFIX
)/share
/man
8 CFLAGS
=-std
=c99
-D_POSIX_C_SOURCE
=200809L
13 CFILES
=$(wildcard *.c
)
14 HFILES
=$(wildcard *.h
)
15 OFILES
=$(patsubst %.c
,%.o
,$(CFILES
))
21 matroid-finder
: $(OFILES
)
22 $(LD
) -o
$@
$^
$(LDFLAGS
)
31 mkdir
-p
$(DESTDIR
)$(BINDIR
)
32 cp
-f matroid-finder
$(DESTDIR
)$(BINDIR
)
33 mkdir
-p
$(DESTDIR
)$(MANDIR
)/man1
34 cp
-f matroid-finder
.1 $(DESTDIR
)$(MANDIR
)/man1
/matroid-finder
.1
38 cd
$(DESTDIR
)$(BINDIR
) && rm -f matroid-finder
39 cd
$(DESTDIR
)$(MANDIR
)/man1
&& rm -f matroid-finder
.1
41 # Not automatically kept in sync!
43 matroid-finder.o
: matroid-finder.c Makefile
$(HFILES
)
44 $(CC
) $(CFLAGS
) -o
$@
-c
$<