Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. subdirs = inline native apps
  2. CC = gcc
  3. CXX = g++
  4. CFLAGS = -std=gnu99 -I$(level)../include
  5. CFLAGS-debug = $(CFLAGS) -I$(level)../../../Pal/lib \
  6. -I$(level)../../../Pal/include/pal
  7. LDFLAGS =
  8. LDFLAGS-debug = $(LDFLAGS) -L$(level)../src -L$(level)../../../Pal/src \
  9. -Wl,-rpath-link=$(abspath $(LEVEL)../src) \
  10. -Wl,-rpath-link=$(abspath $(level)../../../Pal/src) \
  11. -lpal -lsysdb_debug
  12. libs = $(level)../src/libsysdb_debug.so $(level)../../../Pal/src/libpal.so
  13. glibc_dir = $(level)../../build
  14. all: $(targets) $(if $(level),,build-subdirs)
  15. debug: DEBUG=debug
  16. debug: CC=gcc -g
  17. debug: CXX=g++ -g
  18. debug: $(targets) $(if $(level),,build-subdirs)
  19. $(subdirs): %:
  20. cd $@ && make
  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. # Regression Test
  29. rtest: $(rtarget)
  30. for d in $(rtarget); \
  31. do \
  32. make run-$$d || return $$?; \
  33. done
  34. .PHONY: test rtest clean
  35. $(patsubst %,run-%,$(rtarget)): run-%: %
  36. @echo [ run $< $(value arg-$<) ]
  37. @./libpal.so $< $(value arg-$<) > OUTPUT 2> ERROR
  38. @$(value test-$<)
  39. @rm -rf OUTPUT ERROR
  40. clean: $(clean-extra) $(if $(level),,clean-subdirs)
  41. rm -rf $(targets)
  42. build-subdirs:
  43. for f in $(subdirs); do (cd $$f; make $(DEBUG); cd ..); done
  44. clean-subdirs:
  45. for f in $(subdirs); do (cd $$f; make clean; cd ..); done