📄 makefile.defs
字号:
#!/bin/make -f# COPYRIGHT (C) 2004 Eklectic Ally, Inc.---------------------------{{{## See EKLECTIC_LICENSE for information on legal usage of this file. ## -----------------------------------------------------------------}}}######################################################################### DESCRIPTION# This file, Makefile.defs, contains rules for compiling SystemC# under UNIX using gcc.######################################################################## Figure out architecture info#######################################################################PLATFORM=$(shell uname -s)ifeq "$(PLATFORM)" "SunOS" TARGET_ARCH = gccsparcOS5endififeq "$(PLATFORM)" "Linux" TARGET_ARCH = linuxendififeq "$(PLATFORM)" "CYGWIN_NT-5.1" TARGET_ARCH = cygwinendififeq "$(PLATFORM)" "Darwin" TARGET_ARCH = macosxendififndef TARGET_ARCH $(error This makefile only supported on Linux, Cygwin, Darwin or SunOS. I do not recognize platform $(PLATFORM))endififndef SYSTEMC $(error The SYSTEMC environment variable is not set)endififndef SRCS SRCS = $(wildcard *.cpp)endififndef OBJS OBJS = $(SRCS:.cpp=.o)endif# NOTE: In the following SYSTEMC_HOME is purely for Synopsys'# CoCentric System Studio, which uses a non-standard convention for# identifying the location of SystemC includes & libraries.ifneq "$(shell grep systemc $(SRCS))" "" USE_SYSTEMC=1 ifndef SYSTEMC ifdef SYSTEMC_HOME export SYSTEMC=$(SYSTEMC_HOME) else $(error The SYSTEMC environment variable is not set) endif endif ifndef SYSTEMC_HOME export SYSTEMC_HOME=$(SYSTEMC) endif SYSTEMC_VERSION:=$(firstword $(wildcard $(foreach i,. .. ../..,$i/bin/systemc_version)) systemc_version)endif# Following is used to ensure makefile changes are noticed. RULES is# defined in Makefile as the name of *this* file.MAKE_FILES=$(wildcard Makefile ../Makefile) $(RULES) Makefile.deps######################################################################## Standard variables affecting compilation#######################################################################CC := g++ -O0 -ggdb -Wno-deprecated -DDEBUG_SYSTEMCifdef USE_SYSTEMC CC += -D$(shell $(SYSTEMC_VERSION) -var)endififeq "$(TARGET_ARCH)" "macosx" CC += -DMACOSXendifINCDIR = -I. -I.. -I$(SYSTEMC)/include -I$(CYNTH_HOME)/include $(MY_INCLUDES)LIBDIR = -L. -L.. -L$(SYSTEMC)/lib-$(TARGET_ARCH) $(MY_LIBS)LIBS = -lsystemc -lm $(EXTRA_LIBS) $(BDW_EXTRA_LDFLAGS)ifdef BOOST INCDIR += -I$(BOOST) LIBDIR += -L$(BOOST)endifEXE = $(MODULE).x#######################################################################.PHONY: default exe run sim deps compare lint loc perf tar.SUFFIXES: .cc .cpp .o .xdefault: version exeversion: g++ --version @echo -n "SystemC version "; $(SYSTEMC_VERSION) @echo $(RULER)run sim: $(EXE)ifndef NORUN @echo $(RULER)ifneq "$(wildcard ./$(MODULE).scr)" "" ./$(wildcard ./$(MODULE).scr)else ifneq "$(wildcard ./$(MODULE).dat)" "" ./$(EXE) < $(wildcard ./$(MODULE).dat) else ./$(EXE) endifendifelse @echo "Executable is ready"endifexe: $(EXE)deps: Makefile.deps######################################################################## Compilation#######################################################################$(EXE): $(OBJS) $(SYSTEMC)/lib-$(TARGET_ARCH)/libsystemc.a $(MAKE_FILES) $(CC) $(CFLAGS) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(LIBS) 2>&1 | c++filt.cpp.o: $(MAKE_FILES) $(CC) $(CFLAGS) $(INCDIR) -c $<.cc.o: $(MAKE_FILES) $(CC) $(CFLAGS) $(INCDIR) -c $<######################################################################## Dependencies########################################################################----------------------------------------------------------------------# Willamette HDL#----------------------------------------------------------------------Makefile.deps: $(SRCS) $(CC) $(CFLAGS) $(INCDIR) -M $(SRCS) >> Makefile.depsinclude Makefile.deps# COPYRIGHT (C) 2004 Eklectic Ally, Inc.---------------------------{{{## See EKLECTIC_LICENSE for information on legal usage of this file. ## -----------------------------------------------------------------}}}##END $Id: Makefile.defs,v 1.15 2004/04/08 15:40:40 dcblack Exp $
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -