Commit 49d75bfe authored by rmrf's avatar rmrf
Browse files

Update makefile

parent 9dd5afeb
......@@ -7,7 +7,7 @@
########################################################
SYSTEMC ?=
SYSTEMC_HOME ?= $(SYSTEMC)
TARGET_ARCH = linux64
TARGET_ARCH ?= linux64
SYSTEMC_INC_DIR = $(SYSTEMC_HOME)/include
SYSTEMC_LIB_DIR = $(SYSTEMC_HOME)/lib-$(TARGET_ARCH)
......@@ -75,20 +75,21 @@ PRGS := $(patsubst %.cpp,%,$(SRCS))
PRG_SUFFIX=.x
BINS := $(patsubst %,%$(PRG_SUFFIX),$(PRGS))
## OBJS are automagically compiled by make.
OBJS := $(patsubst %,%.o,$(PRGS))
OBJ := $(patsubst %.cpp,%.o,$(SRCS))
##
all : $(BINS)
##
## For clarity sake we make use of:
.SECONDEXPANSION:
OBJ = $(patsubst %$(PRG_SUFFIX),%.o,$@)
#OBJ = $(patsubst %$(PRG_SUFFIX),%.o,$@)
ifeq ($(PRG_SUFFIX_FLAG),0)
BIN = $(patsubst %$(PRG_SUFFIX),%,$@)
else
BIN = $@
endif
## Compile the executables
%$(PRG_SUFFIX) : $(OBJS)
#%$(PRG_SUFFIX) : $(OBJ)
%.x : %.o
$(LIBTOOL) --mode=link --tag=CXX g++ -o $(BIN) $< $(FLAGS) $(LDFLAGS)
%.o: %.cpp
......@@ -102,5 +103,5 @@ else
endif
##
rebuild: veryclean all
#rebuild: veryclean all
#include "systemc.h"
#include <iostream>
SC_MODULE( test ){
sc_in<int> in;
sc_out<int> out;
sc_signal<int> test_signal;
void hello() {
std::cout << sc_time_stamp() << ": Hello" << std::endl;
next_trigger(sc_time(50, SC_NS));
std::cout << sc_time_stamp() << ": World" << std::endl;
next_trigger(sc_time(1000, SC_NS));
std::cout << sc_time_stamp() << ": !!" << std::endl;
}
SC_CTOR( test ) {
SC_METHOD( hello );
}
};
int sc_main(int argc, char *argv[]) {
std::cout << "start of test" << std::endl;
sc_signal<int> sig1;
test test_instance("testing");
test_instance.in(sig1);
test_instance.out(sig1);
sc_start();
std::cout << "End of test" << std::endl;
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment