-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
39 lines (31 loc) · 1.19 KB
/
makefile
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
35
36
37
38
39
CC=mpicc
CFLAGS=-Wall -Wextra -shared -fPIC
OFLAGS=-O2 -march=native
SRC=src
DOCS=docs
MPROF=mprof
LIB=libmprof.so
MAN=mprof.1
.PHONY: all install man clean
all: $(LIB)
$(LIB): $(SRC)/$(MPROF).c $(SRC)/$(MPROF).h
$(CC) $(CFLAGS) $(OFLAGS) -o $@ $<
install: $(LIB) man
@if which install > /dev/null ; then \
install $(LIB) /usr/local/lib ; \
install $(MPROF).in /usr/local/bin/$(MPROF) ; \
mkdir -p /usr/local/man/man1 ; \
install $(DOCS)/$(MAN) /usr/local/man/man1 ; \
else \
echo "Sorry, you haven't install command," \
" you can't install it automatically" ; \
fi
man:
@if which pandoc > /dev/null ; then \
pandoc $(DOCS)/$(MPROF).md -s -t man > $(DOCS)/$(MAN); \
else \
echo "Sorry, because you haven't pandoc," \
" you can't generate a new manpage" ; \
fi
clean:
rm -Rf *~ *.o $(LIB)