Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. -lpal -lsysdb_debug
  10. libs = $(level)../src/libsysdb_debug.so $(level)../../../Pal/src/libpal.so
  11. glibc_dir = $(level)../../build
  12. all: $(targets) $(if $(level),,build-subdirs)
  13. debug: DEBUG=debug
  14. debug: CC=gcc -g
  15. debug: CXX=g++ -g
  16. debug: $(targets) $(if $(level),,build-subdirs)
  17. $(subdirs): %:
  18. cd $@ && make
  19. manifest: manifest.template
  20. rm -rf $@
  21. cp $@.template $@
  22. .PHONY: pal palsec
  23. pal:
  24. ln -sf $(level)../../../Pal/src/libpal.so
  25. palsec:
  26. ln -sf $(level)../../../Pal/src/libpal_sec.so libpal.so
  27. # Regression Test
  28. rtest: $(rtarget)
  29. for d in $(rtarget); \
  30. do \
  31. make run-$$d || return $$?; \
  32. done
  33. .PHONY: test rtest clean
  34. $(patsubst %,run-%,$(rtarget)): run-%: %
  35. @echo [ run $< $(value arg-$<) ]
  36. @./libpal.so $< $(value arg-$<) > OUTPUT 2> ERROR
  37. @$(value test-$<)
  38. @rm -rf OUTPUT ERROR
  39. clean: $(clean-extra) $(if $(level),,clean-subdirs)
  40. rm -rf $(targets)
  41. build-subdirs:
  42. for f in $(subdirs); do (cd $$f; make $(DEBUG); cd ..); done
  43. clean-subdirs:
  44. for f in $(subdirs); do (cd $$f; make clean; cd ..); done