diff options
author | Baruch Sterin <baruchs@gmail.com> | 2017-10-20 14:41:30 -0700 |
---|---|---|
committer | Baruch Sterin <baruchs@gmail.com> | 2017-10-20 14:41:30 -0700 |
commit | 5ab3f0fa6ba1519e24368651f7c5fb87cd5ee33e (patch) | |
tree | 5837bc6e529846314b9facc156341ea63c806b00 | |
parent | 15908929ca6c542cba14d0e3904718c13c20377e (diff) | |
download | abc-5ab3f0fa6ba1519e24368651f7c5fb87cd5ee33e.tar.gz abc-5ab3f0fa6ba1519e24368651f7c5fb87cd5ee33e.tar.bz2 abc-5ab3f0fa6ba1519e24368651f7c5fb87cd5ee33e.zip |
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
-rw-r--r-- | Makefile | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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) |