Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. subdirs = native 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. include $(level)../../../Pal/src/Makefile.Test
  15. libs = $(level)../src/libsysdb_debug.so $(level)../../../Pal/src/libpal.so
  16. glibc_dir = $(level)../../build
  17. all: $(call expand_target,$(exec_target)) $(target) $(if $(level),,build-subdirs)
  18. debug: DEBUG=debug
  19. debug: CC=gcc -g
  20. debug: CXX=g++ -g
  21. debug: $(target) $(if $(level),,build-subdirs)
  22. pal:
  23. [ ! -f $(level)../../../Pal/src/pal ] || ln -sf $(level)../../../Pal/src/pal pal
  24. pal_sec:
  25. [ ! -f $(level)../../../Pal/src/pal_sec ] || ln -sf $(level)../../../Pal/src/pal_sec pal_sec
  26. .PHONY: test clean
  27. clean: $(clean-extra) $(if $(level),,clean-subdirs)
  28. rm -rf $(call expand_target,$(exec_target)) $(target)
  29. build-subdirs:
  30. for f in $(subdirs); do (cd $$f; $(MAKE) $(DEBUG); cd ..); done
  31. ifeq ($(SYS),x86_64-linux-gnu)
  32. ifeq ($(level),)
  33. .PHONY: pack
  34. pack:
  35. for f in $(subdirs); do (cd $$f; $(MAKE) pack; cd ..); done
  36. endif
  37. endif
  38. clean-subdirs:
  39. for f in $(subdirs); do (cd $$f; $(MAKE) clean; cd ..); done