Skip to content

Commit 1235019

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master'
Adding support for Zandronum
2 parents 09e2871 + 546fed9 commit 1235019

27 files changed

+467
-153
lines changed

.github/workflows/build.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build_linux:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: autogen
15+
run: ./autogen.sh
16+
- name: autoreconf force
17+
run: autoreconf --force
18+
- name: configure
19+
run: ./configure
20+
- name: make check
21+
run: make check
22+
- name: make distcheck
23+
run: make distcheck
24+
25+
build_macos:
26+
runs-on: macos-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: install automake
30+
run: brew install automake
31+
- name: autogen
32+
run: ./autogen.sh
33+
- name: autoreconf force
34+
run: autoreconf --force
35+
- name: configure
36+
run: ./configure
37+
- name: make check
38+
run: make check
39+
40+
build_windows:
41+
runs-on: windows-latest
42+
steps:
43+
- uses: actions/checkout@v2
44+
- uses: ilammy/msvc-dev-cmd@v1
45+
- name: nmake debug build
46+
run: |
47+
nmake -f Makefile.noauto windows_debug

.github/workflows/release.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Tag Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build_linux:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: autogen
14+
run: ./autogen.sh
15+
- name: configure
16+
run: ./configure
17+
- name: make
18+
run: QSTAT_VERSION=${{ github.event.release.tag_name }} make
19+
- uses: actions/upload-artifact@v2
20+
with:
21+
name: linux_amd64
22+
path: qstat
23+
24+
build_macos:
25+
runs-on: macos-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: install automake
29+
run: brew install automake
30+
- name: autogen
31+
run: ./autogen.sh
32+
- name: configure
33+
run: ./configure
34+
- name: make
35+
run: QSTAT_VERSION=${{ github.event.release.tag_name }} make
36+
- uses: actions/upload-artifact@v2
37+
with:
38+
name: darwin_amd64
39+
path: qstat
40+
41+
42+
build_windows:
43+
runs-on: windows-latest
44+
env:
45+
QSTAT_VERSION: ${{ github.event.release.tag_name }}
46+
steps:
47+
- uses: actions/checkout@v2
48+
- uses: ilammy/msvc-dev-cmd@v1
49+
- name: nmake
50+
run: |
51+
nmake -f Makefile.noauto windows windows_debug
52+
- uses: actions/upload-artifact@v2
53+
with:
54+
name: windows_amd64
55+
path: qstat.exe
56+
# TODO(austin) build for mac-os which would cover freebsd
57+
# https://github.com/vmactions/freebsd-vm
58+
release:
59+
runs-on: ubuntu-latest
60+
needs:
61+
- build_windows
62+
- build_linux
63+
- build_macos
64+
steps:
65+
- uses: actions/checkout@v2
66+
- uses: actions/download-artifact@v2
67+
with:
68+
path: bin
69+
- name: zip
70+
run: zip -r release.zip bin/* qstat.cfg contrib.cfg LICENSE.*
71+
- name: Release
72+
uses: "softprops/action-gh-release@v1"
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
with:
76+
prerelease: false
77+
tag_name: "${{ github.event.release.tag_name }}"
78+
files: |
79+
release.zip

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ stamp-h1
1919
*.pdb
2020
qstat
2121
qstat.exe
22+
.compiler_flags
23+
.version
24+
version.h

.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

COMPILE.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Compilation instructions for qStat
2+
3+
## Linux and other GNU systems
4+
5+
### Build
6+
```shall
7+
./configure && make
8+
```
9+
### Install
10+
To install qstat run
11+
```shell
12+
make install
13+
```
14+
### Configuration
15+
To see which configuration parameters can be tweaked, run
16+
```shell
17+
./configure --help
18+
```
19+
20+
If you want to compile from GIT you need to first install `autoconf` and `automake`, then run
21+
```shell
22+
./autogen.sh
23+
```
24+
25+
## Windows
26+
Release build
27+
```shell
28+
nmake /f Makefile.noauto windows
29+
```
30+
Debug build
31+
```shell
32+
nmake /f Makefile.noauto windows_debug
33+
```
34+
35+
## Solaris
36+
```shell
37+
make -f Makefile.noauto solaris
38+
```
39+
40+
## HPUX
41+
```shell
42+
make -f Makefile.noauto hpux
43+
```

COMPILE.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.

Makefile.am

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,39 @@
11
SUBDIRS = template info
22

3-
CPPFLAGS = -Dsysconfdir=\"$(sysconfdir)\" @CPPFLAGS@
3+
CFLAGS = -Dsysconfdir=\"$(sysconfdir)\" @CFLAGS@
4+
5+
.PHONY: $(builddir)/.compiler_flags
6+
$(builddir)/.compiler_flags:
7+
echo '$(CFLAGS)' | cmp -s - $@ || echo '$(CFLAGS)' > $@
8+
9+
.PHONY: $(builddir)/.version
10+
$(builddir)/.version:
11+
ver=$$($(srcdir)/scripts/version.sh); \
12+
echo $$ver | cmp -s - $@ || echo $$ver > $@
13+
14+
$(builddir)/version.h: $(builddir)/.version $(srcdir)/version.h.tmpl
15+
ver=$$(cat $<); \
16+
file=$$(sed "s/CHANGEME/$$ver/g" $(srcdir)/version.h.tmpl); \
17+
echo "$$file" | cmp -s - $@ || echo "$$file" > $@
18+
19+
clean-local:
20+
-rm -f $(builddir)/.compiler_flags $(builddir)/.version $(builddir)/version.h
21+
22+
distclean-local: clean-local
23+
24+
BUILT_SOURCES = \
25+
.compiler_flags \
26+
.version \
27+
version.h
428

529
bin_PROGRAMS = qstat
630

31+
qstat_DEPENDENCIES = \
32+
$(builddir)/.compiler_flags
33+
734
qstat_SOURCES = \
35+
version.h.tmpl \
36+
version.h \
837
xform.c xform.h \
938
config.c config.h \
1039
debug.c debug.h \
@@ -48,12 +77,9 @@ qstat_SOURCES = \
4877
dist_configfiles_DATA = qstat.cfg
4978
configfilesdir = $(sysconfdir)
5079

51-
EXTRA_DIST = CHANGES.txt COMPILE.txt LICENSE.txt \
80+
EXTRA_DIST = CHANGES.txt COMPILE.md LICENSE.txt \
5281
Makefile.noauto \
5382
ChangeLog \
5483
qstatdoc.html \
55-
contrib.cfg
56-
57-
cl:
58-
cvs2cl.pl --utc --no-wrap --separate-header --no-times -f ChangeLog.cvs
59-
rm -f ChangeLog.cvs.bak qstat.core
84+
contrib.cfg \
85+
scripts/version.sh

Makefile.noauto

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ SRC = \
5151
skulltag_huffman.c \
5252
zandronum.c
5353

54+
SOURCES = \
55+
version.h \
56+
$(SRC)
57+
5458
OBJ = $(SRC:.c=.obj)
5559
O = $(SRC:.c=.o)
5660

@@ -59,34 +63,72 @@ WINDOWS_LIBS = wsock32.lib
5963
OS2_LIBS = so32dll.lib tcp32dll.lib
6064
EMX_LIBS = -lsocket
6165

66+
ifdef MAKEDIR: # gmake: false; nmake: unused target
67+
!ifdef MAKEDIR # gmake: not seen; nmake: true
68+
# nmake specific code
69+
70+
LINK = link.exe
71+
LFLAGS = /nologo
72+
CFLAGS = $(CFLAGS) /nologo
73+
PHONY = .phony
74+
75+
.phony:
76+
77+
.version: $(PHONY)
78+
call scripts/gen-version.cmd
79+
80+
version.h: .version
81+
82+
!else # and now the other
83+
else
84+
# gnu make targets
85+
.PHONY: .compiler_flags
86+
.compiler_flags:
87+
echo '$(CFLAGS)' | cmp -s - $@ || echo '$(CFLAGS)' > $@
88+
89+
.PHONY: .version
90+
.version:
91+
@ver=$$(./scripts/version.sh); \
92+
echo "$$ver" | cmp -s - $@ || echo "$$ver" > $@
93+
94+
version.h: .version
95+
@ver=$$(cat .version); \
96+
file=$$(sed "s/CHANGEME/$$ver/g" ./version.h.tmpl); \
97+
echo "$$file" | cmp -s - $@ || echo "$$file" > $@
98+
99+
endif # gmake: close condition; nmake: not seen
100+
!endif : # gmake: unused target; nmake close conditional
101+
62102
all: qstat
63103

64-
qstat: $(O)
104+
qstat: .compiler_flags version.h $(O)
65105
$(CC) $(CFLAGS) -o qstat $(O) $(LDFLAGS) $(LDLIBS)
66106

67-
solaris: $(SRC)
107+
solaris: .compiler_flags $(SOURCES)
68108
$(CC) $(CFLAGS) -o qstat $(SRC) $(LDFLAGS) $(LDLIBS) $(SOLARIS_LIBS)
69109

70110
aix sgi freebsd macosx osx openbsd irix linux: qstat
71111

72-
hp hpux: $(SRC)
112+
hp hpux: .compiler_flags $(SOURCES)
73113
$(CC) $(CFLAGS) -Ae -o qstat $(SRC) $(LDFLAGS) $(LDLIBS)
74114

75115
win32: windows
76116

77-
windows: $(OBJ)
78-
$(CC) /Feqstat.exe $(OBJ) $(LDFLAGS) $(LDLIBS) $(WINDOWS_LIBS)
117+
.c.obj:
118+
$(CC) $(CFLAGS) -c $<
79119

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

84-
os2: $(SRC)
85-
$(CC) /Q /W0 /C+ $(SRC)
86-
ilink /PM:VIO $(OBJ) /out:qstat.exe $(LDFLAGS) $(LDLIBS) $(OS2_LIBS)
125+
# windows release forced
126+
windows: $(SOURCES)
127+
$(CC) $(CFLAGS) $(SRC) /Feqstat.exe $(WINDOWS_LIBS)
87128

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

91133
clean:
92-
rm -f qstat core qstat.exe *.pdb $(O) $(OBJ)
134+
-rm -f qstat core qstat.exe *.pdb .compiler_flags .version version.h $(O) $(OBJ)

0 commit comments

Comments
 (0)