File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ BINDIR=./
2121INCDIR =-I. -I./include -I$(SYSTEMC ) /include -Ibasic_protocol -I$(SYSTEMC ) /include/tlm_core/tlm_2
2222LIBDIR =-L. -L$(SYSTEMC ) /lib-linux64
2323
24+ ifdef USING_TLM_TB_EN
25+ SRCDIRS =$(SRCDIR ) ../edge-detector/src
26+ INCDIR+ =-I../edge-detector/include
27+ endif # USING_TLM_TB_EN
28+
2429ifdef INCLUDE_OPENCV
2530# Target
2631LIBS+ =-lopencv_imgcodecs -lopencv_core -lopencv_highgui -lopencv_imgproc
@@ -35,15 +40,29 @@ LFLAGS += $(shell pkg-config --libs opencv4)
3540endif # INCLUDE_OPENCV_PKG
3641endif # INCLUDE_OPENCV
3742
43+ ifndef USING_TLM_TB_EN
3844SOURCES := $(wildcard $(SRCDIR ) /* .cpp)
3945INCLUDES := $(wildcard $(INCDIR ) /* .hpp)
4046OBJECTS := $(SOURCES:$(SRCDIR ) /%.cpp=$(OBJDIR ) /%.o )
47+ else
48+ SOURCES = $(wildcard * .cpp) $(foreach DIR, $(SRCDIRS ) , $(wildcard $(DIR ) /* .cpp) )
49+ SOURCES_WITHOUT_PATH = $(notdir $(SOURCES ) )
50+ INCLUDES := $(wildcard $(INCDIR ) /* .hpp)
51+ OBJECTS = $(SOURCES_WITHOUT_PATH:%.cpp=$(OBJDIR ) /%.o )
52+
53+ VPATH = $(sort $(dir $(SOURCES ) ) )
54+ endif # USING_TLM_TB_EN
4155
4256$(BINDIR ) /$(TARGET ) : clean $(OBJECTS )
4357 @$(LD ) $(OBJECTS ) $(LFLAGS ) $(LIBS ) $(LIBDIR ) -o $@
4458
59+ ifndef USING_TLM_TB_EN
4560$(OBJECTS ) : $(OBJDIR ) /% .o : $(SRCDIR ) /% .cpp
4661 @$(CC ) $(CFLAGS ) $(INCDIR ) -c $< -o $@
62+ else
63+ $(OBJECTS ) : $(OBJDIR ) /% .o : % .cpp
64+ @$(CC ) $(CFLAGS ) $(INCDIR ) -c $< -o $@
65+ endif # USING_TLM_TB_EN
4766
4867.PHONY : clean
4968clean :
Original file line number Diff line number Diff line change 1+ #ifndef USING_TLM_TB_EN
2+
13#define int64 systemc_int64
24#define uint64 systemc_uint64
35#include < systemc.h>
@@ -350,3 +352,5 @@ int sc_main(int, char*[])
350352
351353 return 0 ;
352354}
355+
356+ #endif // USING_TLM_TB_EN
Original file line number Diff line number Diff line change @@ -37,6 +37,24 @@ ifdef EDGE_DETECTOR_AT_EN
3737 LFLAGS += -DEDGE_DETECTOR_AT_EN
3838endif # EDGE_DETECTOR_AT_EN
3939
40+ ifdef USING_TLM_TB_EN
41+ CFLAGS += -DUSING_TLM_TB_EN
42+ LFLAGS += -DUSING_TLM_TB_EN
43+ endif # USING_TLM_TB_EN
44+
45+ .PHONY : print-all
46+ print-all :
47+ @echo " Incdir is $( INCDIR) "
48+ @echo " Srcdir is $( SRCDIR) "
49+ @echo " Srcdirs are $( SRCDIRS) "
50+ @echo " Includes are $( INCLUDES) "
51+ @echo " Sources are $( SOURCES) "
52+ @echo " Objects are $( OBJECTS) "
53+
54+ .PHONY : print-flags
55+ print-flags :
56+ @echo " Flags are $( CFLAGS) "
57+
4058# Run the compiled file
4159run :
4260 @./test
You can’t perform that action at this time.
0 commit comments