From 6e6ae1cc3d00f3f976c7a694f691bf469ad71bda Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 3 May 2019 23:03:04 -0600 Subject: [PATCH] fixed bugs in CMakeLists.txt and Makefile --- CMakeLists.txt | 6 ++-- ace2/Makefile | 48 +++++++++---------------------- vpr7_x2p/libarchfpga/Makefile | 2 +- vpr7_x2p/libpcre/Makefile | 2 +- vpr7_x2p/libprinthandler/Makefile | 2 +- vpr7_x2p/vpr/Makefile | 2 +- 6 files changed, 20 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7de52b958..33fd05769 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,9 +182,9 @@ set_target_properties(libpcre pcredemo set_target_properties(libprinthandler printhandlerdemo PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/vpr7_x2p/libprinthandlerdemo" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/vpr7_x2p/libprinthandlerdemo" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/vpr7_x2p/libprinthandlerdemo") + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/vpr7_x2p/libprinthandler" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/vpr7_x2p/libprinthandler" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/vpr7_x2p/libprinthandler") set_target_properties(libvpr vpr PROPERTIES diff --git a/ace2/Makefile b/ace2/Makefile index d03d31a28..311a4a44c 100644 --- a/ace2/Makefile +++ b/ace2/Makefile @@ -1,6 +1,7 @@ CC = g++ CFLAGS = -g -O0 -w -LFLAGS = -g -O0 +LFLAGS = -g -O0 +INC_FLAGS = -fpermissive OBJ_DIR = OBJ SRC_DIR = SRC @@ -9,45 +10,22 @@ LIB = -lm EXE = ace -ABC_DIR = ../abc_with_bb_support -#ABC_DIR = ../abc +#ABC_DIR = ../abc_with_bb_support +ABC_DIR = ../abc ABC_LIB = libabc.a ABC_LIB_PATH = $(ABC_DIR)/$(ABC_LIB) -ABC_HEADERS = -I $(ABC_DIR)/src/base/io \ - -I $(ABC_DIR)/src/base/abc \ - -I $(ABC_DIR)/src/base/main \ - -I $(ABC_DIR)/src/base/cmd \ - -I $(ABC_DIR)/src/misc/vec \ - -I $(ABC_DIR)/src/misc/util \ - -I $(ABC_DIR)/src/misc/st \ - -I $(ABC_DIR)/src/misc/extra \ - -I $(ABC_DIR)/src/misc/ext \ - -I $(ABC_DIR)/src/misc/espresso \ - -I $(ABC_DIR)/src/misc/avl \ - -I $(ABC_DIR)/src/misc/nm \ - -I $(ABC_DIR)/src/aig/aig \ - -I $(ABC_DIR)/src/aig/hop \ - -I $(ABC_DIR)/src/aig/mem \ - -I $(ABC_DIR)/src/aig/tim \ - -I $(ABC_DIR)/src/aig/ssw \ - -I $(ABC_DIR)/src/aig/fra \ - -I $(ABC_DIR)/src/aig/nwk \ - -I $(ABC_DIR)/src/aig/ntl \ - -I $(ABC_DIR)/src/aig/gia \ - -I $(ABC_DIR)/src/aig/dar \ - -I $(ABC_DIR)/src/aig/ioa \ - -I $(ABC_DIR)/src/bdd/cudd \ - -I $(ABC_DIR)/src/bdd/mtr \ - -I $(ABC_DIR)/src/bdd/epd \ - -I $(ABC_DIR)/src/map/if \ - -I $(ABC_DIR)/src/sat/bsat +ABC_HEADERS = -I$(ABC_DIR)/src -LIBS = -lm -ldl +LIBS = -lm -ldl -lreadline -pthread DEFINES = -DLIN +OBJ = $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c)) +OBJ_DIRS=$(sort $(dir $(OBJ))) +DEP := $(OBJ:.o=.d) + $(EXE): $(OBJ) Makefile $(ABC_LIB_PATH) - $(CC) $(OBJ) $(CFLAGS) $(ABC_HEADERS) $(ABC_LIB_PATH) $(LIBS) -o $(EXE) + $(CC) $(OBJ) $(CFLAGS) $(INC_FLAGS) $(ABC_HEADERS) $(ABC_LIB_PATH) $(LIBS) -o $(EXE) clean: rm -f $(EXE) $(OBJ) $(DEP) $(TARGET) $(EXE) @@ -60,8 +38,8 @@ clean: # timestamp check. Every write to the directory updates the timestamp thus # without this, all but the last file written to a directory would appear # to be out of date. -$(OBJ): OBJ/%.o:$(SRC)/%.c | $$(dir $$@D) - $(CC) -c $< $(CFLAGS) -o $@ $(ABC_HEADERS) $(DEFINES) $(LIBS) +$(OBJ): $(OBJ_DIR)/%.o:$(SRC_DIR)/%.c | $$(dir $$@D) + $(CC) -c $< $(CFLAGS) $(INC_FLAGS) -o $@ $(ABC_HEADERS) $(DEFINES) $(LIBS) # Silently create target directories as need $(OBJ_DIRS): diff --git a/vpr7_x2p/libarchfpga/Makefile b/vpr7_x2p/libarchfpga/Makefile index d3077a7a1..36c7ea3da 100644 --- a/vpr7_x2p/libarchfpga/Makefile +++ b/vpr7_x2p/libarchfpga/Makefile @@ -61,7 +61,7 @@ libarchfpga.a: $(OBJ) ../libpcre/libpcre.a ../libprinthandler/libprinthandler.a # timestamp check. Every write to the directory updates the timestamp thus # without this, all but the last file written to a directory would appear # to be out of date. -$(OBJ): OBJ/%.o:$(SRC_DIR)/%.c | $$(dir $$@D) +$(OBJ): $(OBJ_DIR)/%.o:$(SRC_DIR)/%.c | $$(dir $$@D) $(CC) $(FLAGS) $(INC_FLAGS) -c $< -o $@ # Silently create target directories as need diff --git a/vpr7_x2p/libpcre/Makefile b/vpr7_x2p/libpcre/Makefile index ee291d3d1..62bee6dd5 100644 --- a/vpr7_x2p/libpcre/Makefile +++ b/vpr7_x2p/libpcre/Makefile @@ -56,7 +56,7 @@ libpcre.a: $(OBJ) Makefile # timestamp check. Every write to the directory updates the timestamp thus # without this, all but the last file written to a directory would appear # to be out of date. -$(OBJ): OBJ/%.o:$(SRC_DIR)/%.c | $$(dir $$@D) +$(OBJ): $(OBJ_DIR)/%.o:$(SRC_DIR)/%.c | $$(dir $$@D) $(CC) $(FLAGS) -MD -MP -I$(OTHER_DIR) -ISRC -c $< -o $@ # Silently create target directories as need diff --git a/vpr7_x2p/libprinthandler/Makefile b/vpr7_x2p/libprinthandler/Makefile index 61a43d219..8afe4ee83 100644 --- a/vpr7_x2p/libprinthandler/Makefile +++ b/vpr7_x2p/libprinthandler/Makefile @@ -59,7 +59,7 @@ libprinthandler.a: $(OBJ) Makefile ../libpcre/libpcre.a # timestamp check. Every write to the directory updates the timestamp thus # without this, all but the last file written to a directory would appear # to be out of date. -$(OBJ): OBJ/%.o:$(SRC_DIR)/%.cxx | $$(dir $$@D) +$(OBJ): $(OBJ_DIR)/%.o:$(SRC_DIR)/%.cxx | $$(dir $$@D) $(CC) $(FLAGS) -MD -MP $(OTHER_DIR) -ISRC -c $< -o $@ # Silently create target directories as need diff --git a/vpr7_x2p/vpr/Makefile b/vpr7_x2p/vpr/Makefile index 7d02303b2..f7784e4e3 100755 --- a/vpr7_x2p/vpr/Makefile +++ b/vpr7_x2p/vpr/Makefile @@ -114,7 +114,7 @@ libvpr_shell.a: $(OBJ) Makefile libarchfpga # timestamp check. Every write to the directory updates the timestamp thus # without this, all but the last file written to a directory would appear # to be out of date. -$(OBJ): OBJ/%.o:$(SRC_DIR)/%.c | $$(dir $$@D) +$(OBJ): $(OBJ_DIR)/%.o:$(SRC_DIR)/%.c | $$(dir $$@D) $(CC) $(FLAGS) -MD -MP -I$(OTHER_DIR) -ISRC/util -c $< -o $@ # Silently create target directories as need