Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. subdirs = inline native benchmark regression apps
  2. SYS ?= $(shell gcc -dumpmachine)
  3. export SYS
  4. CC = gcc
  5. CXX = g++
  6. CFLAGS = -std=gnu99 -I$(level)../include
  7. CFLAGS-debug = $(CFLAGS) -I$(level)../../../Pal/lib \
  8. -I$(level)../../../Pal/include/pal
  9. LDFLAGS =
  10. LDFLAGS-debug = $(LDFLAGS) -L$(level)../src -L$(level)../../../Pal/src \
  11. -Wl,-rpath-link=$(abspath $(LEVEL)../src) \
  12. -Wl,-rpath-link=$(abspath $(level)../../../Pal/src) \
  13. -lpal -lsysdb_debug
  14. libs = $(level)../src/libsysdb_debug.so $(level)../../../Pal/src/libpal.so
  15. glibc_dir = $(level)../../build
  16. all: $(target) $(if $(level),,build-subdirs)
  17. debug: DEBUG=debug
  18. debug: CC=gcc -g
  19. debug: CXX=g++ -g
  20. debug: $(target) $(if $(level),,build-subdirs)
  21. manifest: manifest.template
  22. rm -rf $@
  23. cp $@.template $@
  24. pal:
  25. [ ! -f $(level)../../../Pal/src/pal ] || ln -sf $(level)../../../Pal/src/pal pal
  26. pal_sec:
  27. [ ! -f $(level)../../../Pal/src/pal_sec ] || ln -sf $(level)../../../Pal/src/pal_sec pal_sec
  28. .PHONY: test clean
  29. clean: $(clean-extra) $(if $(level),,clean-subdirs)
  30. rm -rf $(target)
  31. build-subdirs:
  32. for f in $(subdirs); do (cd $$f; $(MAKE) $(DEBUG); cd ..); done
  33. ifeq ($(SYS),x86_64-linux-gnu)
  34. ifeq ($(level),)
  35. .PHONY: pack
  36. pack:
  37. for f in $(subdirs); do (cd $$f; $(MAKE) pack; cd ..); done
  38. endif
  39. endif
  40. clean-subdirs:
  41. for f in $(subdirs); do (cd $$f; $(MAKE) clean; cd ..); done