Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. CFLAGS = -Wall -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -O2 -Werror -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-strict-overflow -Wno-array-bounds -Wno-shift-negative-value -Wempty-body -Wtype-limits -Wno-unused-result -fPIC -Wmissing-field-initializers -std=gnu99
  2. INCLUDE += -I../lib
  3. SRCS = video_memory_test.c
  4. OBJS = $(SRCS:.c=.o)
  5. #source search path
  6. vpath %.c
  7. # name of the outputfile (library)
  8. TARGET = vidmem_test
  9. #Here are rules for building codes and generating object library.
  10. all: tags
  11. @echo ---------------------------------------
  12. @echo "Usage: make [ system | testdata | versatile | integrator | android]"
  13. @echo "system - PC system model (== pclinux)"
  14. @echo "testdata - PC system model for test data creation"
  15. @echo "eval - PC system model for evaluation with frame limit"
  16. @echo "versatile - ARM versatile with FPGA HW"
  17. @echo "integrator - ARM integrator with FPGA HW"
  18. @echo "android - ARM android"
  19. @echo "NOTE! Make sure to do 'make clean'"
  20. @echo "between compiling to different targets!"
  21. @echo ---------------------------------------
  22. .PHONY: system_lib system testdata clean depend
  23. evaluation: eval
  24. eval: system
  25. system_static: testdata
  26. system: testdata
  27. # for libva
  28. system_lib: system
  29. testdata: .depend
  30. .PHONY: hwlinux
  31. hwlinux:
  32. hwlinux: .depend $(TARGET)
  33. $(TARGET): $(OBJS)
  34. $(CC) $(CFLAGS) $(OBJS) -L../output/rootfs/bsp/vidmem/lib -lvmem -lm -lpthread -o $(TARGET)
  35. %.o: %.c
  36. $(CC) -c $(CFLAGS) $(INCLUDE) $< -o $@
  37. clean:
  38. $(RM) $(TARGET)
  39. $(RM) .depend
  40. $(RM) *.o *.gcno *.gcda
  41. tags:
  42. ctags ../kernel_mode/*h ./*[ch]
  43. depend .depend: $(SRCS)
  44. @echo "[CC] $@"
  45. @$(CC) -M $(DEBFLAGS) $(INCLUDE) $^ > .depend
  46. ifneq (clean, $(findstring clean, $(MAKECMDGOALS)))
  47. ifeq (.depend, $(wildcard .depend))
  48. include .depend
  49. endif
  50. endif