-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
36 lines (31 loc) · 1009 Bytes
/
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
MPICC ?= mpicc
PREFIX ?=/usr
CFLAGS ?=
AR ?= ar
PIC ?= -fPIC
.PHONY: all
all: libbigfile.a libbigfile-mpi.a
install: libbigfile.a libbigfile-mpi.a
install -d $(PREFIX)
install -d $(PREFIX)/lib
install -d $(PREFIX)/include
install libbigfile.a $(PREFIX)/lib/libbigfile.a
install libbigfile-mpi.a $(PREFIX)/lib/libbigfile-mpi.a
install bigfile-mpi.h $(PREFIX)/include/bigfile-mpi.h
install bigfile.h $(PREFIX)/include/bigfile.h
bigfile.o: bigfile.c bigfile.h bigfile-internal.h
$(MPICC) $(CFLAGS) $(PIC) -o $@ -c bigfile.c
bigfile-record.o: bigfile-record.c bigfile.h bigfile-internal.h
$(MPICC) $(CFLAGS) $(PIC) -o $@ -c bigfile-record.c
bigfile-mpi.o: bigfile-mpi.c bigfile-mpi.h bigfile-internal.h mp-mpiu.h
$(MPICC) $(CFLAGS) $(PIC) -o $@ -c bigfile-mpi.c
mp-mpiu.o: mp-mpiu.c mp-mpiu.h
$(MPICC) $(CFLAGS) $(PIC) -o $@ -c mp-mpiu.c
libbigfile.a: bigfile.o bigfile-record.o
$(AR) r $@ $^
$(AR) s $@
libbigfile-mpi.a: bigfile-mpi.o mp-mpiu.o
$(AR) r $@ $^
$(AR) s $@
clean:
rm -f *.a *.o