Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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../kernel_mode
  3. SRCS = isp_venc_shake_hal.c
  4. OBJS = $(SRCS:.c=.o)
  5. #source search path
  6. vpath %.c
  7. # name of the outputfile (library)
  8. IVSLIB = libivs.a
  9. IVSSLIB = libivs.so
  10. #Here are rules for building codes and generating object library.
  11. all: tags
  12. @echo ---------------------------------------
  13. @echo "Usage: make [ system | testdata | versatile | integrator | android]"
  14. @echo "system - PC system model (== pclinux)"
  15. @echo "testdata - PC system model for test data creation"
  16. @echo "eval - PC system model for evaluation with frame limit"
  17. @echo "versatile - ARM versatile with FPGA HW"
  18. @echo "integrator - ARM integrator with FPGA HW"
  19. @echo "android - ARM android"
  20. @echo "NOTE! Make sure to do 'make clean'"
  21. @echo "between compiling to different targets!"
  22. @echo ---------------------------------------
  23. .PHONY: system_lib system testdata clean depend
  24. evaluation: eval
  25. eval: system
  26. system_static: testdata
  27. system: testdata
  28. # for libva
  29. system_lib: system
  30. testdata: .depend $(IVSLIB)
  31. .PHONY: hwlinux
  32. hwlinux:
  33. hwlinux: .depend $(IVSLIB) $(IVSSLIB)
  34. $(IVSLIB): $(OBJS)
  35. @echo "[AR] $@"
  36. $(AR) rcs $(IVSLIB) $(OBJS)
  37. $(IVSSLIB): $(OBJS)
  38. $(CC) -fPIC -Wl,-no-undefined -shared $(CFLAGS) $(OBJS) -lm -lpthread -o $(IVSSLIB)
  39. %.o: %.c
  40. $(CC) -c $(CFLAGS) $(INCLUDE) $< -o $@
  41. clean:
  42. $(RM) $(IVSLIB) $(IVSSLIB)
  43. $(RM) .depend
  44. $(RM) *.o *.gcno *.gcda
  45. tags:
  46. ctags ../kernel_mode/*h ./*[ch]
  47. depend .depend: $(SRCS)
  48. @echo "[CC] $@"
  49. @$(CC) -M $(DEBFLAGS) $(INCLUDE) $^ > .depend
  50. ifneq (clean, $(findstring clean, $(MAKECMDGOALS)))
  51. ifeq (.depend, $(wildcard .depend))
  52. include .depend
  53. endif
  54. endif