From ef51b303873db5e97b9ddcf12cadc0c5df6bb855 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Fri, 11 Oct 2013 09:51:08 -0400 Subject: [PATCH] Fix windows builds, add strip target for makefiles, update distro build makefiles to use it for release builds. --- Makefile | 5 +++++ distro/archlinux/this/Makefile | 2 +- distro/deb/Makefile | 2 +- distro/slackware/this/Makefile | 2 +- distro/win32/Makefile | 2 +- gmqcc.h | 4 +++- platform.h | 9 ++++----- test.c | 1 + util.c | 4 ++++ 9 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 18720c0..96193e7 100644 --- a/Makefile +++ b/Makefile @@ -107,6 +107,11 @@ check: all test: all @ ./$(TESTSUITE) +strip: $(GMQCC) $(QCVM) $(TESTSUITE) + strip $(GMQCC) + strip $(QCVM) + strip $(TESTSUITE) + clean: rm -rf *.o $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK) *.dat gource.mp4 *.exe gm-qcc.tgz ./cov-int diff --git a/distro/archlinux/this/Makefile b/distro/archlinux/this/Makefile index e89880f..f224103 100644 --- a/distro/archlinux/this/Makefile +++ b/distro/archlinux/this/Makefile @@ -23,7 +23,7 @@ endif base: $(MAKE) -C $(BASEDIR) clean CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ - $(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)/$(PKGDIR)" "PREFIX=$(PREFIX)" install + $(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)/$(PKGDIR)" "PREFIX=$(PREFIX)" strip install @echo "pkgname = gmqcc" > $(PKGINFO) @echo "pkgver = $(MAJOR).$(MINOR).$(PATCH)-$(PKGREL)" >> $(PKGINFO) @echo "pkgdesc = An Improved Quake C Compiler" >> $(PKGINFO) diff --git a/distro/deb/Makefile b/distro/deb/Makefile index 7594400..9752f7a 100644 --- a/distro/deb/Makefile +++ b/distro/deb/Makefile @@ -17,7 +17,7 @@ endif base: $(MAKE) -C $(BASEDIR) clean CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ - $(MAKE) -C $(BASEDIR) DESTDIR=distro/deb/$(DEBDIR) PREFIX=$(PREFIX) install + $(MAKE) -C $(BASEDIR) DESTDIR=distro/deb/$(DEBDIR) PREFIX=$(PREFIX) strip install @install -d -m755 $(DEBDIR)/DEBIAN @echo "Package: gmqcc" > $(CONTROL) @echo "Version: $(MAJOR).$(MINOR).$(PATCH)" >> $(CONTROL) diff --git a/distro/slackware/this/Makefile b/distro/slackware/this/Makefile index 294c396..3c28cb0 100644 --- a/distro/slackware/this/Makefile +++ b/distro/slackware/this/Makefile @@ -20,7 +20,7 @@ endif base: $(MAKE) -C $(BASEDIR) clean CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ - $(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)" "PREFIX=$(PREFIX)" install + $(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)" "PREFIX=$(PREFIX)" strip install gzip -9 $(PKGDIR)/usr/share/man/man?/*.? strip -s $(PKGDIR)/usr/bin/* mkdir $(PKGDIR)/install diff --git a/distro/win32/Makefile b/distro/win32/Makefile index 99ae52e..62bb220 100644 --- a/distro/win32/Makefile +++ b/distro/win32/Makefile @@ -7,7 +7,7 @@ BINDIR := gmqcc-$(MAJOR).$(MINOR).$(PATCH) base: $(MAKE) CC=i486-mingw32-gcc UNAME=MINGW32 -C $(BASEDIR) clean - $(MAKE) CC=i486-mingw32-gcc UNAME=MINGW32 -C $(BASEDIR) DESTDIR=distro/win32/$(BINDIR) PREFIX=/ install + $(MAKE) CC=i486-mingw32-gcc UNAME=MINGW32 -C $(BASEDIR) DESTDIR=distro/win32/$(BINDIR) PREFIX=/ strip install @mkdir -p $(BINDIR)/doc @groff -mandoc $(BINDIR)/man1/gmqpak.1 | ps2pdf - $(BINDIR)/doc/gmqpak.pdf @groff -mandoc $(BINDIR)/man1/qcvm.1 | ps2pdf - $(BINDIR)/doc/qcvm.pdf diff --git a/gmqcc.h b/gmqcc.h index 61429f3..7ebb1c6 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -313,7 +313,9 @@ const struct tm *util_localtime(const time_t *timer); const char *util_ctime (const time_t *timer); typedef struct fs_file_s fs_file_t; -bool util_isatty (fs_file_t *); + +bool util_isatty(fs_file_t *); +const char *util_tmpnam(char *); /* * A flexible vector implementation: all vector pointers contain some diff --git a/platform.h b/platform.h index 27abc64..bb76568 100644 --- a/platform.h +++ b/platform.h @@ -60,14 +60,13 @@ int dd_stat; char dd_name[1]; } DIR; - -# ifdef S_ISDIR -# undef S_ISDIR -# endif /*! S_ISDIR */ -# define S_ISDIR(X) ((X)&_S_IFDIR) # else # include # endif /*!__MINGW32__*/ + +# ifndef S_ISDIR +# define S_ISDIR(X) ((X)&_S_IFDIR) +# endif #else # include # include diff --git a/test.c b/test.c index 2672cb6..c937d7f 100644 --- a/test.c +++ b/test.c @@ -152,6 +152,7 @@ static int task_pclose(fs_file_t **handles) { return status; } #else + #include typedef struct { fs_file_t *handles[3]; char name_err[L_tmpnam]; diff --git a/util.c b/util.c index 12cfb3e..f6b9808 100644 --- a/util.c +++ b/util.c @@ -282,6 +282,10 @@ bool util_isatty(fs_file_t *file) { return false; } +const char *util_tmpnam(char *str) { + return platform_tmpnam(str); +} + /* * A small noncryptographic PRNG based on: * http://burtleburtle.net/bob/rand/smallprng.html -- 2.39.2