aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-11-26 05:59:11 -0500
committerB. Watson <urchlay@slackware.uk>2025-11-26 05:59:11 -0500
commit40ef881bd66fd3d9acf2e70d9046de25d18ba2da (patch)
tree62aafd633e28179ba781611260f964282e04a5d3 /src
parent664a630518f8f92a8b262e973790bbdb0dfc33ad (diff)
downloadunalf-40ef881bd66fd3d9acf2e70d9046de25d18ba2da.tar.gz
Add alf/alf.exe to install and windows targets.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile16
-rw-r--r--src/alf.c8
2 files changed, 18 insertions, 6 deletions
diff --git a/src/Makefile b/src/Makefile
index 0106dc7..161376b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -93,19 +93,22 @@ alf.1: alf.rst ver.rst manftr.rst
clean:
rm -rf *.o unalf alfsum *.exe wintmp \
- unalf.html alfsum.html *.aarch64.elf *.com.dbg
+ alf.html unalf.html alfsum.html *.aarch64.elf *.com.dbg
# these are generated files, but they *are* checked into git.
realclean: clean
rm -f unalf.1 alfsum.1 usage.c
install: all
- [ "$(STRIP)" = "yes" ] && strip unalf alfsum || true
+ [ "$(STRIP)" = "yes" ] && strip alf unalf alfsum || true
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(DOCDIR)
+ $(INSTALL_DATA) alf.1 $(DESTDIR)$(MAN1DIR)
$(INSTALL_DATA) unalf.1 $(DESTDIR)$(MAN1DIR)
$(INSTALL_DATA) alfsum.1 $(DESTDIR)$(MAN1DIR)
+ [ "$(GZIP_MAN)" = "yes" ] && $(GZIP) $(DESTDIR)$(MAN1DIR)/alf.1 || true
[ "$(GZIP_MAN)" = "yes" ] && $(GZIP) $(DESTDIR)$(MAN1DIR)/unalf.1 || true
[ "$(GZIP_MAN)" = "yes" ] && $(GZIP) $(DESTDIR)$(MAN1DIR)/alfsum.1 || true
+ $(INSTALL_PROGRAM) alf $(DESTDIR)$(BINDIR)
$(INSTALL_PROGRAM) unalf $(DESTDIR)$(BINDIR)
$(INSTALL_PROGRAM) alfsum $(DESTDIR)$(BINDIR)
cp -r ../README.txt ../LICENSE.txt ../TODO.txt ../doc ../examples $(DESTDIR)$(DOCDIR)
@@ -113,7 +116,10 @@ install: all
crosswin: clean
$(MAKE) CC=~/x-tools/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-gcc
-html: alfsum.html unalf.html
+html: alfsum.html unalf.html alf.html
+
+alf.html: alf.rst
+ rst2html alf.rst > alf.html
alfsum.html: alfsum.rst
rst2html alfsum.rst > alfsum.html
@@ -124,11 +130,11 @@ unalf.html: unalf.rst
windows: crosswin html
rm -rf wintmp ../unalf-$(VERSION)-win64.zip
mkdir -p wintmp/{doc,examples}
- cp unalf.exe alfsum.exe wintmp
+ cp alf.exe unalf.exe alfsum.exe wintmp
cd .. ; for i in README.txt TODO.txt doc/*.txt doc/Arcinfo examples/*.txt; do perl -pe 's,\n,\r\n,;' $$i > src/wintmp/$$i; done
perl -p -e 's,\n,\r\n,;' -e 's,\@VERSION\@,$(VERSION),g;' README_Windows.txt.in > wintmp/README_Windows.txt
cp ../examples/*.alf wintmp/examples
- cp alfsum.html unalf.html wintmp
+ cp alfsum.html unalf.html alf.html wintmp
cd wintmp ; zip -r ../../unalf-$(VERSION)-win64.zip *
windows-upload: windows
diff --git a/src/alf.c b/src/alf.c
index c3b210d..d03ece7 100644
--- a/src/alf.c
+++ b/src/alf.c
@@ -125,9 +125,15 @@ void atarify_filename(char *result) {
*p = toupper(*p);
}
+#if defined(__MINGW32__) || defined(__MINGW64__)
+#define MOD_TIME st_mtime
+#else
+#define MOD_TIME st_mtim.tv_sec
+#endif
+
/* see Arcinfo for the gory details. */
unsigned long get_msdos_date_time(void) {
- time_t t = in_file_stat.st_mtim.tv_sec;
+ time_t t = in_file_stat.MOD_TIME;
struct tm *tm;
int msdos_year;
u16 ms_date, ms_time;