0

特定の共有オブジェクト ライブラリが存在しない場合にのみ実行するルールを作成しようとしています。

$(OUTDIR)/libv8-$(ARCH).so: v8

v8: # to be able to build V8 only with "make v8"
    cd V8; bash V8Update.sh

ただし、V8Update.sh毎回実行されます。ここに完全がありMakefileます:

CC=g++
V8INCLUDEDIR=V8/build/v8/include
CFLAGS=-c -Wall -std=c++0x -fPIC -I$(V8INCLUDEDIR) -I/usr/include -I/usr/include/c++/4.6                               \
       -I/usr/include/c++/4.6/backward -I/usr/include/c++/4.6/x86_64-linux-gnu -I/usr/include/x86_64-linux-gnu         \
       -I/usr/lib/gcc/x86_64-linux-gnu/4.6/include -I/usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed                   \
       -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/
DEPS=ProxyTypes.h $(V8INCLUDEDIR)/v8.h $(V8INCLUDEDIR)/v8-debug.h $(V8INCLUDEDIR)/v8stdint.h
ARCH=x64 # TODO: Add support for building 32-bit libraries.
LDFLAGS=-shared -lglib-2.0 -L/usr/lib/x86_64-linux-gnu/ #-Wl,--no-undefined
SOURCES=Exports.cpp FunctionTemplateProxy.cpp HandleProxy.cpp ObjectTemplateProxy.cpp Utilities.cpp V8EngineProxy.cpp  \
        ValueProxy.cpp
OBJECTS=$(patsubst %,$(OUTDIR)/%,$(SOURCES:.cpp=.o))
LIBRARY=libV8_Net_Proxy.so

.PHONY: all v8 release debug makeoutdir clean copybin

all: debug copybin

v8: # to be able to build V8 only with "make v8"
    cd V8; bash V8Update.sh

release: OUTDIR=bin/Release
debug: OUTDIR=bin/Debug

release debug:
    $(MAKE) -S makeoutdir $(LIBRARY) OUTDIR=$(OUTDIR)


makeoutdir:
    mkdir -p $(OUTDIR)

clean:
    rm bin/ -rf
#   rm V8/build -rf

copybin:
    cp -a bin/Debug/*.so ../bin/Debug

$(LIBRARY): $(OUTDIR)/libv8-$(ARCH).so $(OBJECTS)
    $(CC) $(LDFLAGS) -lv8-$(ARCH) -L$(OUTDIR) -o $(patsubst %,$(OUTDIR)/%,$@) $(OBJECTS)

$(OUTDIR)/libv8-$(ARCH).so: v8

$(OUTDIR)/%.o: %.cpp $(DEPS)
    $(CC) $(CFLAGS) -o $@ $<

ここで何が間違っていますか?

4

1 に答える 1

1

そのはず

v8: $(OUTDIR)/libv8-$(ARCH).so

$(OUTDIR)/libv8-$(ARCH).so:
    cd V8; bash V8Update.sh

偽のターゲットに依存することはできません-毎回実行されます(それは機能です)。

于 2013-09-13T09:18:29.737 に答える