Makefile 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. #-------------------------------------------------------------------------------
  2. #- --
  3. #- This software is confidential and proprietary and may be used --
  4. #- only as expressly authorized by a licensing agreement from --
  5. #- --
  6. #- Hantro Products Oy. --
  7. #- --
  8. #- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY --
  9. #- ALL RIGHTS RESERVED --
  10. #- --
  11. #- The entire notice above must be reproduced --
  12. #- on all copies and should not be removed. --
  13. #- --
  14. #-------------------------------------------------------------------------------
  15. #-
  16. #-- Abstract : Makefile for 8290 JPEG encoder testbench
  17. #--
  18. #-------------------------------------------------------------------------------
  19. # Comment/uncomment the following line to disable/enable debugging
  20. DEBUG = y
  21. # set this to 'y' for Electric Fence checking
  22. USE_EFENCE = n
  23. # Add your debugging flag (or not) to CFLAGS
  24. ifeq ($(DEBUG),y)
  25. DEBFLAGS = -O1 -g -DDEBUG
  26. else
  27. DEBFLAGS = -O3 -DNDEBUG
  28. endif
  29. # This is used for testing with system model
  30. # encoder uses comment header spefified in test bench
  31. # if you want to use own comment header data, comment this out!
  32. DEBFLAGS +=-DTB_DEFINED_COMMENT
  33. # this is used only for integrator tracing
  34. #DEBFLAGS += -DASIC_WAVE_TRACE_TRIGGER
  35. # Architecture flags for gcc
  36. #ARCH =
  37. #CROSS_COMPILE =
  38. ifeq ($(shell uname -m),x86_64)
  39. ifneq (,$(findstring pclinux,$(MAKECMDGOALS)))
  40. export ARCH = -m32
  41. endif
  42. ifneq (,$(findstring system,$(MAKECMDGOALS)))
  43. export ARCH = -m32
  44. endif
  45. ifneq (,$(findstring testdata,$(MAKECMDGOALS)))
  46. export ARCH = -m32
  47. endif
  48. ifneq (,$(findstring eval,$(MAKECMDGOALS)))
  49. export ARCH = -m32
  50. endif
  51. endif
  52. # C -compiler name, can be replaced by another compiler(replace gcc)
  53. CC = $(CROSS_COMPILE)gcc
  54. # the path where to find header files
  55. INCFLAGS = -I../../../inc -I../../../source/jpeg -I../../../source/common \
  56. -I../../debug_trace
  57. ifeq ($(USE_EFENCE), y)
  58. EFENCE= -DUSE_EFENCE -I/afs/hantro.com/projects/adder/users/atna/efence_2_4_13 \
  59. -L/afs/hantro.com/projects/adder/users/atna/efence_2_4_13 \
  60. -lefence -lpthread
  61. endif
  62. # compiler switches
  63. CFLAGS = $(ARCH) -Wall -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE \
  64. $(DEBFLAGS) $(INCFLAGS)
  65. # list of used sourcefiles
  66. SRCS = JpegTestBench.c EncGetOption.c
  67. OBJS = $(SRCS:.c=.o)
  68. # name of the input library
  69. LIB = ../../lib8290enc.a
  70. # System model library
  71. MODELLIB = ../../../../system/models/enc8290_asic_model.a
  72. # System model library that writes test data traces
  73. TESTDATALIB = ../../../../system/models/enc8290_asic_model_trace.a
  74. # name of the output executable
  75. TARGET = jpeg_testenc
  76. # MACRO for cleaning object -files
  77. RM = rm -f
  78. #Here are rules for building codes and generating executable
  79. all: tags
  80. @echo ---------------------------------------
  81. @echo "Usage: make [ system | testdata | versatile ]"
  82. @echo "system - PC system model (==pclinux)"
  83. @echo "testdata - PC system model for test data creation"
  84. @echo "integrator - ARM integrator with FPGA HW"
  85. @echo "versatile - ARM versatile with FPGA HW"
  86. @echo "NOTE! Make sure to do 'make libclean'"
  87. @echo "between compiling to different targets!"
  88. @echo ---------------------------------------
  89. # Use other makefiles to build the libraries
  90. $(MODELLIB):
  91. $(MAKE) -w -C ../../../../system/models
  92. $(TESTDATALIB):
  93. $(MAKE) -w -C ../../../../system/models testdata
  94. $(LIB):
  95. $(MAKE) -w -C ../.. $(TARGETENV) INCLUDE_H264=n INCLUDE_VIDSTAB=n USE_EFENCE=$(USE_EFENCE)
  96. pclinux: system
  97. .PHONY: system
  98. system: TARGETENV = system
  99. system: $(MODELLIB) $(LIB) $(OBJS)
  100. $(CC) $(CFLAGS) $(OBJS) $(LIB) $(MODELLIB) -o $(TARGET)
  101. eval: TARGET = jpeg_enc_8290_eval
  102. eval: system
  103. .PHONY: testdata
  104. testdata: TARGETENV = testdata
  105. testdata: $(TESTDATALIB) $(LIB) $(OBJS)
  106. $(CC) $(CFLAGS) $(OBJS) $(LIB) $(TESTDATALIB) -o $(TARGET)
  107. versatile: TARGETENV = versatile
  108. versatile: CFLAGS+=-DSDRAM_LM_BASE=0x00000000 -DMEMALLOC_MODULE_PATH=\"/tmp/dev/memalloc\"
  109. versatile: CROSS_COMPILE = arm-none-linux-gnueabihf-
  110. versatile: ARCH = -mcpu=cortex-a5 -mtune=cortex-a5
  111. versatile: LIB += -lpthread
  112. versatile: $(OBJS)
  113. $(MAKE) -w -C ../.. $@ INCLUDE_H264=n INCLUDE_VIDSTAB=n \
  114. USE_EFENCE=$(USE_EFENCE) CROSS_COMPILE=$(CROSS_COMPILE) ARCH="$(ARCH)"
  115. $(CC) $(CFLAGS) $(OBJS) $(LIB) $(EFENCE) -o $(TARGET)
  116. integrator: TARGETENV = integrator
  117. integrator: CROSS_COMPILE= arm-linux-
  118. integrator: ARCH = -mcpu=arm9tdmi -mtune=arm9tdmi
  119. integrator: CFLAGS+=-DSDRAM_LM_BASE=0x80000000 -DMEMALLOC_MODULE_PATH=\"/dev/memalloc\"
  120. integrator: LIB += -lpthread
  121. integrator: $(OBJS)
  122. $(MAKE) -w -C ../.. $@ INCLUDE_H264=n INCLUDE_VIDSTAB=n \
  123. USE_EFENCE=$(USE_EFENCE) CROSS_COMPILE=$(CROSS_COMPILE) ARCH="$(ARCH)"
  124. $(CC) $(CFLAGS) $(OBJS) $(LIB) $(EFENCE) -o $(TARGET)
  125. system_cov: CC = covc --retain -t!JpegTestBench.c,!EncGetOption.c g++
  126. system_cov: TARGETENV = system_cov
  127. system_cov: $(MODELLIB) $(LIB) $(OBJS)
  128. $(CC) $(CFLAGS) $(OBJS) $(LIB) $(MODELLIB) -o $(TARGET)
  129. .PHONY: clean
  130. clean:
  131. $(RM) *.o core* *~ $(TARGET)*
  132. .PHONY: libclean
  133. libclean: clean
  134. $(MAKE) -w -C ../.. clean
  135. .PHONY: tags
  136. tags:
  137. ctags ../../../inc/*.h *.c ../../../source/jpeg/*.[ch] \
  138. ../../../source/common/*.[ch] ../../ewl/*c