1 TARGETS = libprofile.so prof smap
6 LIB_PATH ?= $(dir $(lastword $(wildcard /lib*/ld-*.so /lib*/*-linux-gnu/ld-*.so)))
7 $(if $(LIB_PATH),,$(error cant find ld-.so))
8 CFLAGS += -DLIB='"$(LIB_PATH)"'
9 ASM_PATH ?= $(dir $(lastword $(wildcard /usr/include/asm/signal.h /usr/include/x86_64-linux-gnu/asm/signal.h)))
16 cp -a libprofile.so $(DESTDIR)$(LIB_PATH)/.
17 cp -a prof smap $(DESTDIR)$(BIN_PATH)/.
21 rm -f $(DESTDIR)$(LIB_PATH)/libprofile.so
22 rm -f $(DESTDIR)$(BIN_PATH)/prof
23 rm -f $(DESTDIR)$(BIN_PATH)/smap
25 libprofile.so: profile.c
26 $(CC) $(CFLAGS) -fPIC -shared -o $@ $<
29 $(CC) $(CFLAGS) -o $@ $<
32 $(CXX) $(CFLAGS) -o $@ $< \
33 -Wall -I/usr/include/libiberty -llzma -liberty
37 sys.h: $(ASM_PATH/signal.h $(ASM_PATH)/unistd.h
38 echo "char *sysreq_name[] = {" > sys.h
39 ./mksyscallent < $(ASM_PATH)/unistd_$(BITS).h >> sys.h
41 echo "char *signal_name[] = {" >> sys.h
42 ./mksignalent < $(ASM_PATH)/signal.h >> sys.h
47 rm -f $(TARGETS) tst sys.h