ref: 253c2c84b388fcf7b0c6c9c468051099eddae586
parent: fcd7a13816a7141236e1f66d7dfaa8f44c45d78a
author: Martin Storsjö <martin@martin.st>
date: Fri Jan 24 09:30:08 EST 2014
Do chdir within mktargets.py This simplifies the calling shell script.
--- a/build/mktargets.py
+++ b/build/mktargets.py
@@ -69,8 +69,17 @@
INCLUDE = args.include
if args.out is not None:
OUTFILE = args.out
+else:
+ OUTFILE = os.path.join(args.directory, OUTFILE)
if args.cpp_suffix is not None:
CPP_SUFFIX = args.cpp_suffix
+
+OUTFILE = os.path.abspath(OUTFILE)
+try:
+ os.chdir(args.directory)
+except:
+ sys.exit(1)
+
(cpp, asm) = find_sources()
--- a/build/mktargets.sh
+++ b/build/mktargets.sh
@@ -1,10 +1,10 @@
#!/bin/sh
-(cd codec/decoder && python ../../build/mktargets.py --directory codec/decoder --library decoder --exclude StdAfx.cpp)
-(cd codec/encoder && python ../../build/mktargets.py --directory codec/encoder --library encoder --exclude DllEntry.cpp)
-(cd codec/common && python ../../build/mktargets.py --directory codec/common --library common)
-(cd codec/processing && python ../../build/mktargets.py --directory codec/processing --library processing)
+python build/mktargets.py --directory codec/decoder --library decoder --exclude StdAfx.cpp
+python build/mktargets.py --directory codec/encoder --library encoder --exclude DllEntry.cpp
+python build/mktargets.py --directory codec/common --library common
+python build/mktargets.py --directory codec/processing --library processing
-(cd codec/console/dec && python ../../../build/mktargets.py --directory codec/console/dec --binary h264dec)
-(cd codec/console/enc && python ../../../build/mktargets.py --directory codec/console/enc --binary h264enc)
-(cd test && python ../build/mktargets.py --directory test --binary codec_unittest)
-(cd gtest && python ../build/mktargets.py --directory gtest --library gtest --out ../build/gtest-targets.mk --cpp-suffix .cc --include gtest-all.cc)
+python build/mktargets.py --directory codec/console/dec --binary h264dec
+python build/mktargets.py --directory codec/console/enc --binary h264enc
+python build/mktargets.py --directory test --binary codec_unittest
+python build/mktargets.py --directory gtest --library gtest --out build/gtest-targets.mk --cpp-suffix .cc --include gtest-all.cc