[96927c5] | 1 | # ***************************************************************************** |
---|
| 2 | # Copyright (C) 2015, UChicago Argonne, LLC |
---|
| 3 | # All Rights Reserved |
---|
| 4 | # memlog (ANL-SF-15-081) |
---|
| 5 | # Hal Finkel, Argonne National Laboratory |
---|
| 6 | # |
---|
| 7 | # OPEN SOURCE LICENSE |
---|
| 8 | # |
---|
| 9 | # Under the terms of Contract No. DE-AC02-06CH11357 with UChicago Argonne, LLC, |
---|
| 10 | # the U.S. Government retains certain rights in this software. |
---|
| 11 | # |
---|
| 12 | # Redistribution and use in source and binary forms, with or without |
---|
| 13 | # modification, are permitted provided that the following conditions are met: |
---|
| 14 | # |
---|
| 15 | # 1. Redistributions of source code must retain the above copyright notice, this |
---|
| 16 | # list of conditions and the following disclaimer. |
---|
| 17 | # |
---|
| 18 | # 2. Redistributions in binary form must reproduce the above copyright notice, |
---|
| 19 | # this list of conditions and the following disclaimer in the documentation |
---|
| 20 | # and/or other materials provided with the distribution. |
---|
| 21 | # |
---|
| 22 | # 3. Neither the names of UChicago Argonne, LLC or the Department of Energy nor |
---|
| 23 | # the names of its contributors may be used to endorse or promote products |
---|
| 24 | # derived from this software without specific prior written permission. |
---|
| 25 | # |
---|
| 26 | # ***************************************************************************** |
---|
| 27 | # DISCLAIMER |
---|
| 28 | # |
---|
[9f07fa4] | 29 | # THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. |
---|
[96927c5] | 30 | # |
---|
| 31 | # NEITHER THE UNTED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT OF |
---|
| 32 | # ENERGY, NOR UCHICAGO ARGONNE, LLC, NOR ANY OF THEIR EMPLOYEES, MAKES ANY |
---|
| 33 | # WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY |
---|
| 34 | # FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF ANY INFORMATION, DATA, |
---|
| 35 | # APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT |
---|
| 36 | # INFRINGE PRIVATELY OWNED RIGHTS. |
---|
| 37 | # |
---|
| 38 | # ***************************************************************************** |
---|
| 39 | |
---|
[1bd82e0] | 40 | CXX = /soft/compilers/bgclang/wbin/bgclang++ |
---|
[e1b15ec] | 41 | CXXFLAGS = -std=gnu++0x -O3 -g |
---|
[0ec59c5] | 42 | |
---|
[a7b97b9] | 43 | # When compiling with CXX=powerpc64-bgq-linux-g++, we need these: |
---|
| 44 | CPPFLAGS = -I/bgsys/drivers/ppcfloor -I/bgsys/drivers/ppcfloor/spi/include/kernel/cnk |
---|
| 45 | |
---|
[14e2ab9] | 46 | LDFLAGS = -lpthread -ldl |
---|
[0ec59c5] | 47 | |
---|
[510af01] | 48 | # Set this to use the install target |
---|
| 49 | DESTDIR = /dev/null |
---|
| 50 | |
---|
[493cb97] | 51 | all: libmemlog.so memlog_s.o |
---|
[0ec59c5] | 52 | |
---|
[1bd82e0] | 53 | memlog_s.o: memlog.cpp |
---|
| 54 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o memlog_s.o memlog.cpp |
---|
[0ec59c5] | 55 | |
---|
[1bd82e0] | 56 | libmemlog.so: memlog.cpp |
---|
| 57 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -fPIC -shared -o libmemlog.so memlog.cpp |
---|
[0ec59c5] | 58 | |
---|
[4598848] | 59 | install: all memlog_analyze README |
---|
| 60 | cp -a libmemlog.so memlog_s.o memlog_analyze README $(DESTDIR)/ |
---|
[3c9fc94] | 61 | echo '-Wl,--wrap,malloc,--wrap,valloc,--wrap,realloc,--wrap,calloc,--wrap,memalign,--wrap,free,--wrap,posix_memalign,--wrap,mmap,--wrap,mmap64,--wrap,munmap $(DESTDIR)/memlog_s.o -lpthread -ldl' > $(DESTDIR)/memlog_s_ld_cmds |
---|
[510af01] | 62 | |
---|
[0ec59c5] | 63 | clean: |
---|
[493cb97] | 64 | rm -f memlog_s.o libmemlog.so |
---|
[0ec59c5] | 65 | |
---|