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 | # |
---|
29 | # THE SOFTWARE IS SUPPLIED “AS IS” WITHOUT WARRANTY OF ANY KIND. |
---|
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 | |
---|
40 | CXX = /soft/compilers/bgclang/wbin/bgclang++ |
---|
41 | CXXFLAGS = -std=gnu++0x -O3 -g |
---|
42 | |
---|
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 | |
---|
46 | LDFLAGS = -lpthread -ldl |
---|
47 | |
---|
48 | # Set this to use the install target |
---|
49 | DESTDIR = /dev/null |
---|
50 | |
---|
51 | all: libmemlog.so memlog_s.o |
---|
52 | |
---|
53 | memlog_s.o: memlog.cpp |
---|
54 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o memlog_s.o memlog.cpp |
---|
55 | |
---|
56 | libmemlog.so: memlog.cpp |
---|
57 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -fPIC -shared -o libmemlog.so memlog.cpp |
---|
58 | |
---|
59 | install: all memlog_analyze README |
---|
60 | cp -a libmemlog.so memlog_s.o memlog_analyze README $(DESTDIR)/ |
---|
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 |
---|
62 | |
---|
63 | clean: |
---|
64 | rm -f memlog_s.o libmemlog.so |
---|
65 | |
---|