mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2025-01-19 07:17:23 +01:00
makefile: Add -Werror flag for release builds, only.
Keep normal/dev builds (e.g. just run make) without this flag to allow keeping warnings around and not being forced to clean them up during development.
This commit is contained in:
parent
f3ead543ab
commit
6da3732968
31
GNUmakefile
31
GNUmakefile
@ -22,24 +22,40 @@ gitrev := $(shell git rev-parse HEAD)
|
||||
cppflags := -I src -I src/main -I src/test -DGITREV=$(gitrev)
|
||||
cflags := -O2 -pipe -ffunction-sections -fdata-sections \
|
||||
-Wall -std=c99
|
||||
ldflags := -Wl,--gc-sections -static-libgcc
|
||||
cflags_release := -Werror
|
||||
ldflags := -Wl,--gc-sections -static-libgcc
|
||||
|
||||
#
|
||||
# The first target that GNU Make encounters becomes the default target.
|
||||
# Define our ultimate target (`all') here, and also some helpers
|
||||
#
|
||||
|
||||
all: print-building
|
||||
all: build
|
||||
|
||||
.PHONY: clean release code-format print-building
|
||||
.PHONY: \
|
||||
clean \
|
||||
code-format \
|
||||
print-building \
|
||||
print-release \
|
||||
run-tests \
|
||||
version
|
||||
|
||||
release: \
|
||||
print-release \
|
||||
clean \
|
||||
code-format \
|
||||
all \
|
||||
run-tests
|
||||
|
||||
build: \
|
||||
print-building \
|
||||
version
|
||||
|
||||
print-building:
|
||||
@echo "Building gitrev "$(gitrev)"..."
|
||||
@echo "Build gitrev "$(gitrev)"..."
|
||||
|
||||
print-release:
|
||||
@echo "Release build started"
|
||||
|
||||
release: print-release clean code-format run-tests
|
||||
@echo "Starting release build..."
|
||||
|
||||
clean:
|
||||
@echo "Cleaning up..."
|
||||
@ -89,6 +105,7 @@ define t_moddefs
|
||||
|
||||
cppflags_$3 += $(cppflags) -DBUILD_MODULE=$3
|
||||
cflags_$3 += $(cflags)
|
||||
release: cflags_$3 += $(cflags_release)
|
||||
ldflags_$3 += $(ldflags)
|
||||
srcdir_$3 ?= src/main/$3
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user