en
end
-base_dir = "doc"
+base_dir = "MolbyDoc"
system("mkdir -p #{base_dir}; rm -rf #{base_dir}/*")
# Output to files (en and jp)
DESTPREFIX = build/release
COPT = -O2 -g
endif
+MAKEDIR = $(PWD)
DESTDIR = $(PWD)/$(DESTPREFIX)
CFLAGS = $(CPPFLAGS) $(COPT) $(CPP_EXTRA_FLAGS) $(RUBY_CFLAGS) $(WX_CPPFLAGS)
LDFLAGS = $(WX_LDFLAGS) $(LD_EXTRA_FLAGS) $(RUBY_LDFLAGS)
ifeq ($(TARGET_PLATFORM),MSW)
setup: build/release/$(PRODUCT_DIR)/$(FINAL_EXECUTABLE)
- /c/Program\ Files\ \(x86\)/Inno\ Setup\ 5/iscc molby.iss
+ mkdir -p ../Products
+ (/c/Program\ Files\ \(x86\)/Inno\ Setup\ 5/iscc molby.iss && mv Output/SetupMolbyWin.exe ../Products)
+ (cd build/release/$(PRODUCT_DIR) && zip -r $(MAKEDIR)/../Products/MolbyWin.zip * -x \*.DS_Store \*.svn*)
endif
clean:
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
+#include <libgen.h> /* for dirname() */
#include <ruby.h>
int fd;
char *scriptdir;
static const char fname[] = "startup.rb";
- char *molbydir = getenv("MOLBYDIR");
- if (molbydir == NULL) {
- fprintf(stderr, "Please define the environmental variable MOLBYDIR to specify the location in which the 'Scripts' directory is present.\n");
- exit(1);
+ char *argv0 = argv[0];
+ char *p = dirname(argv0);
+ if (p != NULL) {
+ asprintf(&p, "%s%cMolby_resources", p, PATH_SEPARATOR);
+ } else {
+ p = ".";
}
- asprintf(&scriptdir, "%s%cScripts", molbydir, PATH_SEPARATOR);
+ asprintf(&scriptdir, "%s%cScripts", p, PATH_SEPARATOR);
fd = open(".", O_RDONLY);
chdir(scriptdir);
DefaultDirName = {pf}\Molby
DefaultGroupName = Molby
UninstallDisplayIcon = {app}\Molby.exe
-OutputBaseFileName = SetupMolby
+OutputBaseFileName = SetupMolbyWin
[Files]
Source: "build\release\Molby\Molby.exe"; DestDir: {app}
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
+ E43C5D9518E553D9004FE397 /* ShellScript */,
);
buildRules = (
);
buildPhases = (
E49BFB731886E2E400188237 /* Sources */,
E49BFB741886E2E400188237 /* Frameworks */,
+ E43C5DE818E57C56004FE397 /* ShellScript */,
);
buildRules = (
);
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
+ E43C5D9518E553D9004FE397 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "if [ \"$BUILD_STYLE\" = \"Release\" ]; then\n rm -f \"$PROJECT_DIR/../Products/MolbyDoc.zip\"\n (cd $PROJECT_DIR/../Documents && zip -r \"$PROJECT_DIR/../Products/MolbyDoc.zip\" MolbyDoc -x \\*.DS_Store -x \\*.svn*) || exit 1\nfi\n";
+ };
+ E43C5DE818E57C56004FE397 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 12;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "cp -a \"$BUILT_PRODUCTS_DIR/Molby.app/Contents/Resources\" \"$BUILT_PRODUCTS_DIR\" || exit 1\n(cd \"$BUILT_PRODUCTS_DIR\" && rm -rf Molby_resources && mv Resources Molby_resources) || exit 1\nif [ \"$BUILD_STYLE\" = \"Release\" ]; then\n (mkdir -p \"$PROJECT_DIR/../Products/temp/Molby\" && cd \"$PROJECT_DIR/../Products/temp/Molby\" && rm -rf *) || exit 1\n (cd \"$BUILT_PRODUCTS_DIR\" && cp -a Molby.app Molby_command Molby_resources \"$PROJECT_DIR/../Products/temp/Molby\") || exit 1\n (cd \"$PROJECT_DIR/../Products/temp\" && rm -f ../MolbyMac.zip && zip -r ../MolbyMac.zip Molby -x \\*.DS_Store -x \\*.svn*) || exit 1\n rm -rf \"$PROJECT_DIR/../Products/temp\" || exit 1\nfi\n";
+ };
E4FC7B57183E516E0064FB2E /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;