mirror of https://github.com/YosysHQ/abc.git
Patch by Larry Doolittle to allow out-of-source builds of ABC.
Usage:
Starting from an empty directory:
(1) set AS to point to the location of ABC
(2) reconstruct the directory structure of ABC in the new directory:
mkdir -p `cd $AS && find src -type d`
(3) Build ABC:
make -f $AS/Makefile VPATH=$AS ABCSRC=$AS
This commit is contained in:
parent
15908929ca
commit
5ab3f0fa6b
13
Makefile
13
Makefile
|
|
@ -4,6 +4,7 @@ CXX := g++
|
|||
LD := $(CXX)
|
||||
|
||||
MSG_PREFIX ?=
|
||||
ABCSRC = .
|
||||
|
||||
$(info $(MSG_PREFIX)Using CC=$(CC))
|
||||
$(info $(MSG_PREFIX)Using CXX=$(CXX))
|
||||
|
|
@ -39,9 +40,9 @@ ARCHFLAGS_EXE ?= ./arch_flags
|
|||
$(ARCHFLAGS_EXE) : arch_flags.c
|
||||
$(CC) arch_flags.c -o $(ARCHFLAGS_EXE)
|
||||
|
||||
INCLUDES += -Isrc
|
||||
INCLUDES += -I$(ABCSRC)/src
|
||||
|
||||
ARCHFLAGS ?= $(shell $(CC) arch_flags.c -o $(ARCHFLAGS_EXE) && $(ARCHFLAGS_EXE))
|
||||
ARCHFLAGS ?= $(shell $(CC) $(ABCSRC)/arch_flags.c -o $(ARCHFLAGS_EXE) && $(ARCHFLAGS_EXE))
|
||||
ARCHFLAGS := $(ARCHFLAGS)
|
||||
|
||||
OPTFLAGS ?= -g -O
|
||||
|
|
@ -135,7 +136,7 @@ GARBAGE := core core.* *.stackdump ./tags $(PROG) arch_flags
|
|||
|
||||
.PHONY: all default tags clean docs cmake_info
|
||||
|
||||
include $(patsubst %, %/module.make, $(MODULES))
|
||||
include $(patsubst %, $(ABCSRC)/%/module.make, $(MODULES))
|
||||
|
||||
OBJ := \
|
||||
$(patsubst %.cc, %.o, $(filter %.cc, $(SRC))) \
|
||||
|
|
@ -163,15 +164,15 @@ DEP := $(OBJ:.o=.d)
|
|||
|
||||
%.d: %.c
|
||||
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
|
||||
$(VERBOSE)./depends.sh $(CC) `dirname $*.c` $(OPTFLAGS) $(INCLUDES) $(CFLAGS) $*.c > $@
|
||||
$(VERBOSE)$(ABCSRC)/depends.sh $(CC) `dirname $*.c` $(OPTFLAGS) $(INCLUDES) $(CFLAGS) $< > $@
|
||||
|
||||
%.d: %.cc
|
||||
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
|
||||
$(VERBOSE)./depends.sh $(CXX) `dirname $*.cc` $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $*.cc > $@
|
||||
$(VERBOSE)$(ABCSRC)/depends.sh $(CXX) `dirname $*.cc` $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $< > $@
|
||||
|
||||
%.d: %.cpp
|
||||
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
|
||||
$(VERBOSE)./depends.sh $(CXX) `dirname $*.cpp` $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $*.cpp > $@
|
||||
$(VERBOSE)$(ABCSRC)/depends.sh $(CXX) `dirname $*.cpp` $(OPTFLAGS) $(INCLUDES) $(CXXFLAGS) $< > $@
|
||||
|
||||
ifndef ABC_MAKE_NO_DEPS
|
||||
-include $(DEP)
|
||||
|
|
|
|||
Loading…
Reference in New Issue