diff --git a/.gitignore b/.gitignore index 57dcfd6..7e9145a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ results/ *.deppo *.swp DRAMSim +libdramsim.a libdramsim.so diff --git a/Makefile b/Makefile index 1ed297c..2e6a4c6 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ endif CXXFLAGS+=$(OPTFLAGS) EXE_NAME=DRAMSim +STATIC_LIB_NAME := libdramsim.a LIB_NAME=libdramsim.so LIB_NAME_MACOS=libdramsim.dylib @@ -22,7 +23,7 @@ LIB_OBJ := $(addsuffix .o, $(basename $(LIB_SRC))) #build portable objects (i.e. with -fPIC) POBJ = $(addsuffix .po, $(basename $(LIB_SRC))) -REBUILDABLES=$(OBJ) ${POBJ} $(EXE_NAME) $(LIB_NAME) +REBUILDABLES=$(OBJ) ${POBJ} $(EXE_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) all: ${EXE_NAME} @@ -35,6 +36,9 @@ $(LIB_NAME): $(POBJ) g++ -g -shared -Wl,-soname,$@ -o $@ $^ @echo "Built $@ successfully" +$(STATIC_LIB_NAME): $(LIB_OBJ) + $(AR) crs $@ $^ + $(LIB_NAME_MACOS): $(POBJ) g++ -dynamiclib -o $@ $^ @echo "Built $@ successfully"