Skip to content

Commit

Permalink
Release builds set NDEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
mike632t committed Feb 11, 2025
1 parent bf859c6 commit cbbe8ef
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
#
# Usage:
#
# make - Rebuild application using release flags.
# make - Incremental make.
# make all
# make release - Rebuild application using release flags.
# make debug - Rebuild application using debug flags.
# make clean - Deletes object files
# make VERBOSE=1 - Verbose output
Expand Down Expand Up @@ -47,8 +48,7 @@ ifneq ($(BUILD),)
CFLAGS += -DBUILD='".$(BUILD)"'
endif

all: clean
all: CFLAGS += -flto -Ofast
all: CFLAGS += -flto -Ofast -D NDEBUG
all: $(PROGRAM) $(OBJECTS)

$(PROGRAM): $(OBJECTS)
Expand All @@ -67,8 +67,11 @@ ifneq ($(VERBOSE),0)
endif
@$(CC) $(CFLAGS) -c $(SOURCES)

release: clean
release: all

debug: clean
debug: CFLAGS += -Og -D DEBUG
debug: CFLAGS += -Og -D DEBUG
debug: $(PROGRAM)

clean:
Expand Down

0 comments on commit cbbe8ef

Please sign in to comment.