Skip to content

Instantly share code, notes, and snippets.

@Kocha
Created March 1, 2012 21:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kocha/1953411 to your computer and use it in GitHub Desktop.
Save Kocha/1953411 to your computer and use it in GitHub Desktop.
Simple Makefile for SystemC-2.3_pub_rev
SYSTEMC_HOME = ### input SystemC install path ###
TARGET_ARCH = linux
SYSTEMC_INC_DIR = $(SYSTEMC_HOME)/include
SYSTEMC_LIB_DIR = $(SYSTEMC_HOME)/lib-$(TARGET_ARCH)
# LIBTOOL Setting
SHELL = /bin/bash
LIBTOOL_DIR = #### input libtool install path ###
LIBTOOL = $(SHELL) $(LIBTOOL_DIR)/libtool
GXX = g++
GCC = gcc
LD = g++
FLAGS = -g -Wall -pedantic -Wno-long-long \
-DSC_INCLUDE_DYNAMIC_PROCESSES -fpermissive \
-I$(SYSTEMC_INC_DIR)
LDFLAGS = -L$(SYSTEMC_LIB_DIR) -lsystemc -lm
SRCS = sc_main.cpp
OBJS=$(SRCS:.cpp=.o)
# main
main: $(OBJS)
> $(LIBTOOL) --mode=link --tag=CXX g++ -o $@ $(OBJS) $(LDFLAGS)
.cpp.o:
> $(LIBTOOL) --mode=compile g++ -c $(FLAGS) $<
%.o: %.c
> $(LIBTOOL) --mode=compile gcc -Wall -c $<
clean:
> rm -f main *.o *.lo
> rm -rf .libs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment