Commit 5ab3f0fa by Baruch Sterin

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
parent 15908929
...@@ -4,6 +4,7 @@ CXX := g++ ...@@ -4,6 +4,7 @@ CXX := g++
LD := $(CXX) LD := $(CXX)
MSG_PREFIX ?= MSG_PREFIX ?=
ABCSRC = .
$(info $(MSG_PREFIX)Using CC=$(CC)) $(info $(MSG_PREFIX)Using CC=$(CC))
$(info $(MSG_PREFIX)Using CXX=$(CXX)) $(info $(MSG_PREFIX)Using CXX=$(CXX))
...@@ -39,9 +40,9 @@ ARCHFLAGS_EXE ?= ./arch_flags ...@@ -39,9 +40,9 @@ ARCHFLAGS_EXE ?= ./arch_flags
$(ARCHFLAGS_EXE) : arch_flags.c $(ARCHFLAGS_EXE) : arch_flags.c
$(CC) arch_flags.c -o $(ARCHFLAGS_EXE) $(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) ARCHFLAGS := $(ARCHFLAGS)
OPTFLAGS ?= -g -O OPTFLAGS ?= -g -O
...@@ -135,7 +136,7 @@ GARBAGE := core core.* *.stackdump ./tags $(PROG) arch_flags ...@@ -135,7 +136,7 @@ GARBAGE := core core.* *.stackdump ./tags $(PROG) arch_flags
.PHONY: all default tags clean docs cmake_info .PHONY: all default tags clean docs cmake_info
include $(patsubst %, %/module.make, $(MODULES)) include $(patsubst %, $(ABCSRC)/%/module.make, $(MODULES))
OBJ := \ OBJ := \
$(patsubst %.cc, %.o, $(filter %.cc, $(SRC))) \ $(patsubst %.cc, %.o, $(filter %.cc, $(SRC))) \
...@@ -163,15 +164,15 @@ DEP := $(OBJ:.o=.d) ...@@ -163,15 +164,15 @@ DEP := $(OBJ:.o=.d)
%.d: %.c %.d: %.c
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$< @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 %.d: %.cc
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$< @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 %.d: %.cpp
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$< @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 ifndef ABC_MAKE_NO_DEPS
-include $(DEP) -include $(DEP)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment