make-netcon.mk 951 B

1234567891011121314151617181920212223242526272829
  1. SHCC=gcc
  2. # intercept-specific
  3. intercept_CFLAGS = -c -fPIC -g -O2 -Wall -std=c99 -D_GNU_SOURCE -DNETCON_INTERCEPT
  4. LIB_NAME = intercept
  5. SHLIB_EXT=dylib
  6. SHLIB_MAJOR = 1
  7. SHLIB_MINOR = 8
  8. COMMON = common
  9. OBJS= netcon/intercept.o
  10. SHLIB = ${LIB_NAME}.${SHLIB_EXT}.${SHLIB_MAJOR}.${SHLIB_MINOR}
  11. SHLDFLAGS = -g -O2 -Wall -I. -nostdlib -shared
  12. LIBS = -ldl -lc -lrt -lpthread
  13. lib:
  14. ${SHCC} $(intercept_CFLAGS) -I. netcon/intercept.c -o netcon/intercept.o
  15. ${SHCC} $(intercept_CFLAGS) -I. netcon/common.c -o netcon/common.o
  16. ${SHCC} $(intercept_CFLAGS) -I. netcon/sendfd.c -o netcon/sendfd.o
  17. ${SHCC} $(SHLDFLAGS) netcon/intercept.o netcon/common.o netcon/sendfd.o -o netcon/libintercept.so.1.0 $(LIBS)
  18. install:
  19. cp netcon/libintercept.so.1.0 /lib/libintercept.so.1.0
  20. ln -sf /lib/libintercept.so.1.0 /lib/libintercept
  21. /usr/bin/install -c netcon/intercept /usr/bin
  22. uninstall:
  23. rm -r /lib/libintercept.so.1.0
  24. rm -r /lib/libintercept
  25. rm -r /usr/bin/intercept