3 jp=$(grep "#define JP" autoconf.h | wc -l)
5 if test $jp -eq 1; then
6 # Prepare the various file paths.
8 OBJ_FILE=$(echo $SRC_FILE | sed -E 's/\.[^./]+$/\.o/')
13 SRC_SUBDIR=$(dirname $SRC_DIR/$SRC_FILE)
14 BUILD_DIR=$SRC_DIR/../build
15 BUILD_SUBDIR=$(dirname $BUILD_DIR/$SRC_FILE)
17 # Create a build directory and generate a symbolic link to the .deps directory.
18 mkdir -p $BUILD_SUBDIR
19 ln -sf $SRC_SUBDIR/.deps $BUILD_SUBDIR/.deps
21 # Delete source and object files when interrupted.
22 trap 'rm -f ${BUILD_DIR}/${SRC_FILE} ${BUILD_DIR}/${OBJ_FILE}' INT
24 # Copy the source file to the build directory while converting its character encoding to EUC-JP.
25 nkf -e $SRC_DIR/$SRC_FILE >$BUILD_DIR/$SRC_FILE
27 # Compile the source file
33 # Delete the source file in the build directory and move the object file to the source directory.
34 rm -f $BUILD_DIR/$SRC_FILE
35 if [ -f $BUILD_DIR/$OBJ_FILE ]; then
36 mv -f $BUILD_DIR/$OBJ_FILE $SRC_DIR/$OBJ_FILE