File indexing completed on 2024-04-28 16:08:40

0001 SLIB=oomtestutil.so
0002 STUB=oomteststub.o
0003 ALL_PRODUCTS=$(SLIB) $(STUB)
0004 
0005 all: $(ALL_PRODUCTS)
0006 
0007 clean:
0008         rm $(ALL_PRODUCTS)
0009 
0010 # -ldl sets the dl library as a dependency of oomtestutil.so. This library
0011 # contains dlsym().
0012 # Utility library must be in a -shared object for LD_PRELOAD to be able to
0013 # load it at all.
0014 $(SLIB): oomtestutil.cpp
0015         g++ -D_GNU_SOURCE -g -fPIC -shared -o $@ $< -ldl
0016 
0017 # We shall produce an object file that must be linked into any executable that
0018 # wants to use our OOM testing utility. The executable must also be linked with
0019 # -ldl. Object files do not allow us to specify dependencies, so using -ldl
0020 # here does not help.
0021 $(STUB): oomteststub.cpp oomtestutil.h
0022         g++ -D_GNU_SOURCE -g -fPIC -c -o $@ $<