aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile23
-rw-r--r--src/unalf.c7
2 files changed, 28 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index a8788ab..4e37624 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -63,7 +63,7 @@ alfsum.1: alfsum.rst ver.rst
$(RST2MAN) alfsum.rst > alfsum.1
clean:
- rm -f *.o unalf alfsum ../f65/f65.o
+ rm -f *.o unalf alfsum ../f65/f65.o *.exe
install: all
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(DOCDIR)
@@ -74,3 +74,24 @@ install: all
$(INSTALL_PROGRAM) unalf $(DESTDIR)$(BINDIR)
$(INSTALL_PROGRAM) alfsum $(DESTDIR)$(BINDIR)
cp -r ../doc/* ../examples $(DESTDIR)$(DOCDIR)
+
+crosswin: clean
+ $(MAKE) CC=~/x-tools/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-gcc
+
+html: alfsum.html unalf.html
+
+alfsum.html: alfsum.rst
+ rst2html alfsum.rst > alfsum.html
+
+unalf.html: unalf.rst
+ rst2html unalf.rst > unalf.html
+
+windows: crosswin html
+ rm -rf wintmp unalf-$(VERSION)-win64.zip
+ mkdir -p wintmp/{doc,examples}
+ cp unalf.exe alfsum.exe wintmp
+ cd .. ; for i in *.txt doc/*.txt doc/Arcinfo examples/*.txt; do sed 's,\n,\r\n,' $$i > src/wintmp/$$i; done
+ cp ../examples/*.alf wintmp/examples
+ cp alfsum.html unalf.html wintmp
+ cd wintmp ; zip -r ../unalf-$(VERSION)-win64.zip *
+
diff --git a/src/unalf.c b/src/unalf.c
index 39685e7..6bfd94d 100644
--- a/src/unalf.c
+++ b/src/unalf.c
@@ -29,7 +29,12 @@ static void set_self(char *argv0) {
static void create_outdir(void) {
int r;
- r = mkdir(opts.outdir, 0777);
+ r =
+#if defined(__MINGW32__) || defined(__MINGW64__)
+ mkdir(opts.outdir);
+#else
+ mkdir(opts.outdir, 0777);
+#endif
if(r < 0 && errno != EEXIST) {
fprintf(stderr, "%s: ", self);
perror(opts.outdir);