Skip to content

Commit

Permalink
Clean up makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
wangvsa committed Aug 6, 2020
1 parent dbdf967 commit e31eded
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
35 changes: 19 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,49 @@ libdir = ${prefix}/librecorder/lib
bindir = ${prefix}/librecorder/bin

CC = ${MPI_DIR}/bin/mpicc
CXX = ${MPI_DIR}/bin/mpicxx

ifeq ("$(wildcard $(CC))","")
CC = mpicc
CXX = mpicxx
endif

LD = @LD@

INCL_DEPS = include/recorder.h include/recorder-log-format.h include/uthash.h

CFLAGS_SHARED = -shared -fPIC -I. -I$(srcdir)/include -I$(srcdir)/../\
CFLAGS_SHARED = -shared -fPIC -I$(srcdir)/include \
-I${MPI_DIR}/include -I/${HDF5_DIR}/include/ \
-D_LARGEFILE64_SOURCE -DRECORDER_PRELOAD

LIBS += -lz @LIBBZ2@
LDFLAGS += -L${MPI_DIR}/lib -L${HDF5_DIR}/lib -lhdf5 -ldl

CFLAGS += $(CFLAGS_SHARED) ${DISABLED_LAYERS}

all: tools/C/reader.so lib/librecorder.so tools/C/recorder2text.out
LDFLAGS += -L${MPI_DIR}/lib -L${HDF5_DIR}/lib -lhdf5 -ldl


lib:
@mkdir -p $@
all: lib/librecorder.so tools/C/reader.so tools/C/recorder2text.out tools/C/overlap_conflict.out

%.po: %.c $(INCL_DEPS) | lib
%.po: %.c | lib
$(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS)

lib/librecorder.so: lib/recorder-mpi.po lib/recorder-mpi-init-finalize.po lib/recorder-hdf5.po lib/recorder-posix.po lib/recorder-logger.po lib/recorder-utils.po
$(CC) $(CFLAGS) -o $@ $^ -lpthread -lrt -lz $(LDFLAGS)

tools/C/reader.so:
$(CC) -fPIC -shared -ldl tools/C/reader.c -o $@
tools/C/reader.so: tools/C/reader.c
$(CC) -fPIC -shared -ldl $^ -o $@

tools/C/recorder2text.out: tools/C/recorder2text.c tools/C/reader.c
$(CC) $^ -o $@

tools/C/overlap_conflict.out: tools/C/overlap_conflict.c tools/C/reader.c tools/C/build_offset_intervals.cpp
$(CXX) $^ -o $@

tools/C/recorder2text.out:
$(CC) tools/C/recorder2text.c tools/C/reader.c -o $@

install:: all
install -d $(libdir) $(bindir)
install -m 755 lib/librecorder.so $(libdir)
install -m 755 tools/C/reader.so $(libdir)
install -m 755 tools/C/recorder2text.out $(bindir)
install -m 755 tools/C/overlap_conflict.out $(bindir)

clean::
rm -f *.o *.a lib/*.o lib/*.po lib/*.a lib/*.so tools/C/*.so tools/C/*.out
rm -f *.o *.a lib/*.o lib/*.po lib/*.a lib/*.so tools/C/*.so tools/C/recorder2text.out

distclean:: clean
4 changes: 2 additions & 2 deletions tools/C/overlap_conflit.cpp → tools/C/overlap_conflict.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ int main(int argc, char* argv[]) {
IntervalsMap *IM = build_offset_intervals(reader, &num_files);


//access_patterns(IM, num_files);
detect_overlaps(IM, num_files);
access_patterns(IM, num_files);
//detect_overlaps(IM, num_files);

for(int i = 0; i < num_files; i++) {
free(IM[i].filename);
Expand Down

0 comments on commit e31eded

Please sign in to comment.