Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
Adding support for Zandronum
  • Loading branch information
Kr3m committed Jan 31, 2023
2 parents 09e2871 + 546fed9 commit 1235019
Show file tree
Hide file tree
Showing 27 changed files with 467 additions and 153 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: autogen
run: ./autogen.sh
- name: autoreconf force
run: autoreconf --force
- name: configure
run: ./configure
- name: make check
run: make check
- name: make distcheck
run: make distcheck

build_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: install automake
run: brew install automake
- name: autogen
run: ./autogen.sh
- name: autoreconf force
run: autoreconf --force
- name: configure
run: ./configure
- name: make check
run: make check

build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1
- name: nmake debug build
run: |
nmake -f Makefile.noauto windows_debug
79 changes: 79 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Tag Release

on:
push:
tags:
- 'v*'

jobs:
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: QSTAT_VERSION=${{ github.event.release.tag_name }} make
- uses: actions/upload-artifact@v2
with:
name: linux_amd64
path: qstat

build_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: install automake
run: brew install automake
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: QSTAT_VERSION=${{ github.event.release.tag_name }} make
- uses: actions/upload-artifact@v2
with:
name: darwin_amd64
path: qstat


build_windows:
runs-on: windows-latest
env:
QSTAT_VERSION: ${{ github.event.release.tag_name }}
steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1
- name: nmake
run: |
nmake -f Makefile.noauto windows windows_debug
- uses: actions/upload-artifact@v2
with:
name: windows_amd64
path: qstat.exe
# TODO(austin) build for mac-os which would cover freebsd
# https://github.com/vmactions/freebsd-vm
release:
runs-on: ubuntu-latest
needs:
- build_windows
- build_linux
- build_macos
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: bin
- name: zip
run: zip -r release.zip bin/* qstat.cfg contrib.cfg LICENSE.*
- name: Release
uses: "softprops/action-gh-release@v1"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
prerelease: false
tag_name: "${{ github.event.release.tag_name }}"
files: |
release.zip
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ stamp-h1
*.pdb
qstat
qstat.exe
.compiler_flags
.version
version.h
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

43 changes: 43 additions & 0 deletions COMPILE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Compilation instructions for qStat

## Linux and other GNU systems

### Build
```shall
./configure && make
```
### Install
To install qstat run
```shell
make install
```
### Configuration
To see which configuration parameters can be tweaked, run
```shell
./configure --help
```

If you want to compile from GIT you need to first install `autoconf` and `automake`, then run
```shell
./autogen.sh
```

## Windows
Release build
```shell
nmake /f Makefile.noauto windows
```
Debug build
```shell
nmake /f Makefile.noauto windows_debug
```

## Solaris
```shell
make -f Makefile.noauto solaris
```

## HPUX
```shell
make -f Makefile.noauto hpux
```
26 changes: 0 additions & 26 deletions COMPILE.txt

This file was deleted.

40 changes: 33 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
SUBDIRS = template info

CPPFLAGS = -Dsysconfdir=\"$(sysconfdir)\" @CPPFLAGS@
CFLAGS = -Dsysconfdir=\"$(sysconfdir)\" @CFLAGS@

.PHONY: $(builddir)/.compiler_flags
$(builddir)/.compiler_flags:
echo '$(CFLAGS)' | cmp -s - $@ || echo '$(CFLAGS)' > $@

.PHONY: $(builddir)/.version
$(builddir)/.version:
ver=$$($(srcdir)/scripts/version.sh); \
echo $$ver | cmp -s - $@ || echo $$ver > $@

$(builddir)/version.h: $(builddir)/.version $(srcdir)/version.h.tmpl
ver=$$(cat $<); \
file=$$(sed "s/CHANGEME/$$ver/g" $(srcdir)/version.h.tmpl); \
echo "$$file" | cmp -s - $@ || echo "$$file" > $@

clean-local:
-rm -f $(builddir)/.compiler_flags $(builddir)/.version $(builddir)/version.h

distclean-local: clean-local

BUILT_SOURCES = \
.compiler_flags \
.version \
version.h

bin_PROGRAMS = qstat

qstat_DEPENDENCIES = \
$(builddir)/.compiler_flags

qstat_SOURCES = \
version.h.tmpl \
version.h \
xform.c xform.h \
config.c config.h \
debug.c debug.h \
Expand Down Expand Up @@ -48,12 +77,9 @@ qstat_SOURCES = \
dist_configfiles_DATA = qstat.cfg
configfilesdir = $(sysconfdir)

EXTRA_DIST = CHANGES.txt COMPILE.txt LICENSE.txt \
EXTRA_DIST = CHANGES.txt COMPILE.md LICENSE.txt \
Makefile.noauto \
ChangeLog \
qstatdoc.html \
contrib.cfg

cl:
cvs2cl.pl --utc --no-wrap --separate-header --no-times -f ChangeLog.cvs
rm -f ChangeLog.cvs.bak qstat.core
contrib.cfg \
scripts/version.sh
70 changes: 56 additions & 14 deletions Makefile.noauto
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ SRC = \
skulltag_huffman.c \
zandronum.c

SOURCES = \
version.h \
$(SRC)

OBJ = $(SRC:.c=.obj)
O = $(SRC:.c=.o)

Expand All @@ -59,34 +63,72 @@ WINDOWS_LIBS = wsock32.lib
OS2_LIBS = so32dll.lib tcp32dll.lib
EMX_LIBS = -lsocket

ifdef MAKEDIR: # gmake: false; nmake: unused target
!ifdef MAKEDIR # gmake: not seen; nmake: true
# nmake specific code

LINK = link.exe
LFLAGS = /nologo
CFLAGS = $(CFLAGS) /nologo
PHONY = .phony

.phony:

.version: $(PHONY)
call scripts/gen-version.cmd

version.h: .version

!else # and now the other
else
# gnu make targets
.PHONY: .compiler_flags
.compiler_flags:
echo '$(CFLAGS)' | cmp -s - $@ || echo '$(CFLAGS)' > $@

.PHONY: .version
.version:
@ver=$$(./scripts/version.sh); \
echo "$$ver" | cmp -s - $@ || echo "$$ver" > $@

version.h: .version
@ver=$$(cat .version); \
file=$$(sed "s/CHANGEME/$$ver/g" ./version.h.tmpl); \
echo "$$file" | cmp -s - $@ || echo "$$file" > $@

endif # gmake: close condition; nmake: not seen
!endif : # gmake: unused target; nmake close conditional

all: qstat

qstat: $(O)
qstat: .compiler_flags version.h $(O)
$(CC) $(CFLAGS) -o qstat $(O) $(LDFLAGS) $(LDLIBS)

solaris: $(SRC)
solaris: .compiler_flags $(SOURCES)
$(CC) $(CFLAGS) -o qstat $(SRC) $(LDFLAGS) $(LDLIBS) $(SOLARIS_LIBS)

aix sgi freebsd macosx osx openbsd irix linux: qstat

hp hpux: $(SRC)
hp hpux: .compiler_flags $(SOURCES)
$(CC) $(CFLAGS) -Ae -o qstat $(SRC) $(LDFLAGS) $(LDLIBS)

win32: windows

windows: $(OBJ)
$(CC) /Feqstat.exe $(OBJ) $(LDFLAGS) $(LDLIBS) $(WINDOWS_LIBS)
.c.obj:
$(CC) $(CFLAGS) -c $<

windows_debug: $(SRC)
rm -f *.pdb
$(CC) $(CFLAGS) /Zi $(SRC) /Feqstat.exe $(WINDOWS_LIBS) /link /fixed:no /incremental:no
# windows dynamic rebuild but doesn't handle a QSTAT_VERSION change.
# use the clean target to force a rebuild.
qstat.exe: version.h $(OBJ)
$(LINK) $(LFLAGS) $(OBJ) $(WINDOWS_LIBS) /out:$@

os2: $(SRC)
$(CC) /Q /W0 /C+ $(SRC)
ilink /PM:VIO $(OBJ) /out:qstat.exe $(LDFLAGS) $(LDLIBS) $(OS2_LIBS)
# windows release forced
windows: $(SOURCES)
$(CC) $(CFLAGS) $(SRC) /Feqstat.exe $(WINDOWS_LIBS)

os2emx: $(SRC)
$(CC) $(CFLAGS) -o qstat.exe $(SRC) $(LDFLAGS) $(LDLIBS) $(EMX_LIBS)
# windows debug forced
windows_debug: $(SOURCES)
$(CC) $(CFLAGS) /Zi $(SRC) /Feqstat.exe $(WINDOWS_LIBS) /link /fixed:no /incremental:no

clean:
rm -f qstat core qstat.exe *.pdb $(O) $(OBJ)
-rm -f qstat core qstat.exe *.pdb .compiler_flags .version version.h $(O) $(OBJ)
Loading

0 comments on commit 1235019

Please sign in to comment.