Skip to content

Commit aafc7a3

Browse files
Build with -O2 by default when CFLAGS is not set, and with /O2 on Windows
1 parent cd06b65 commit aafc7a3

16 files changed

Lines changed: 83 additions & 12 deletions

‎ChangeLog‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Unreleased
5252
* IMPROVED: Read StationXML directly into channels at full precision instead
5353
of through rounded RESP text.
5454

55+
* IMPROVED: Build with -O2 by default when CFLAGS is not set, and with /O2 on Windows.
56+
5557
* CHANGED: Removed the autotools build (configure.ac, Makefile.am,
5658
MKDIST). The GNU make build (Makefile, Build.config) is now the only
5759
Unix build, alongside Makefile.nmake for Windows. Both systems wrote

‎INSTALL.unix‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ steps:
4040
Note: the Makefile requires GNU make, sometimes available as gmake
4141

4242
make -f Makefile
43-
43+
44+
The build uses -O2 unless CFLAGS is set; to choose other flags:
45+
46+
make -f Makefile CFLAGS="-O0 -g"
47+
4448
4. Optionally, install, as root:
4549

4650
make -f Makefile install

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ BUILD_DIR := .
99
endif
1010
TOPDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
1111
ARFLAGS=crv
12+
CFLAGS ?= -O2
1213

1314
export
1415
.PHONY: all

‎libsrc/evalresp/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# This Makefile requires GNU make, sometimes available as gmake.
33

4-
CFLAGS += -I.. -I../mxml
4+
override CFLAGS += -I.. -I../mxml
55

66
EVALRESP_SRC= alloc_fctns.c calc_fctns.c file_ops.c\
77
globmatch.c resp_fctns.c spline.c input.c\

‎libsrc/evalresp/Makefile.nmake‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ OBJ = alloc_fctns.obj calc_fctns.obj file_ops.obj \
88
all: evalresp.lib
99

1010
.c.obj:
11-
$(CC) /Zi /c $*.c /I ..\ /I ..\mxml\ /Wall /DWIN32 /Fo$@
11+
$(CC) /O2 /Zi /c $*.c /I ..\ /I ..\mxml\ /Wall /DWIN32 /Fo$@
1212

1313
evalresp.lib: $(OBJ)
1414
link /lib $(OBJ) /debug /OUT:evalresp.lib

‎libsrc/evalresp_log/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# This Makefile requires GNU make, sometimes available as gmake.
33

4-
CFLAGS += -I..
4+
override CFLAGS += -I..
55

66
EVALRESP_LOG_SRC= helpers.c log.c examples/to_syslog.c examples/to_file.c
77
EVALRESP_LOG_HEADERS= log.h examples/to_syslog.h examples/to_file.h

‎libsrc/evalresp_log/Makefile.nmake‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ OBJ=log.obj helpers.obj examples\to_file.obj
44
all: evalresp_log.lib
55

66
.c.obj:
7-
$(CC) /Zi /c $*.c /I ..\ /Wall /Fo$@
7+
$(CC) /O2 /Zi /c $*.c /I ..\ /Wall /Fo$@
88

99
evalresp_log.lib: $(OBJ)
1010
link /lib $(OBJ) /debug /OUT:evalresp_log.lib

‎libsrc/mxml/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# This Makefile requires GNU make, sometimes available as gmake.
33

4-
CFLAGS += -I.. -I../mxml
4+
override CFLAGS += -I.. -I../mxml
55

66
MXML_SRC= mxml-attr.c mxml-file.c mxml-get.c mxml-index.c mxml-node.c\
77
mxml-options.c mxml-private.c mxml-search.c mxml-set.c

‎libsrc/mxml/Makefile.nmake‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ OBJ= mxml-attr.obj mxml-file.obj mxml-get.obj mxml-index.obj \
66
all: mxmlev.lib
77

88
.c.obj:
9-
$(CC) /Zi /c $*.c /I ..\ /Wall /DWIN32 /Fo$@
9+
$(CC) /O2 /Zi /c $*.c /I ..\ /Wall /DWIN32 /Fo$@
1010

1111
mxmlev.lib: config.h $(OBJ)
1212
link /lib $(OBJ) /debug /OUT:mxmlev.lib

‎libsrc/spline/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# This Makefile requires GNU make, sometimes available as gmake.
33

4-
CFLAGS += -I..
4+
override CFLAGS += -I..
55

66
SPLINE_SRC= spline.c
77
SPLINE_HEADERS= spline.h

0 commit comments

Comments
 (0)