Fix windows builds, add strip target for makefiles, update distro build makefiles to use it for release builds.

This commit is contained in:
Dale Weiler 2013-10-11 09:51:08 -04:00
parent f008cc257d
commit ef51b30387
9 changed files with 21 additions and 10 deletions

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 <dirent.h>
# endif /*!__MINGW32__*/
# ifndef S_ISDIR
# define S_ISDIR(X) ((X)&_S_IFDIR)
# endif
#else
# include <sys/types.h>
# include <sys/stat.h>

1
test.c
View file

@ -152,6 +152,7 @@ static int task_pclose(fs_file_t **handles) {
return status;
}
#else
#include <sys/stat.h>
typedef struct {
fs_file_t *handles[3];
char name_err[L_tmpnam];

4
util.c
View file

@ -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