Skip to content

Commit

Permalink
Update Makefile.in
Browse files Browse the repository at this point in the history
General Flags: Flags that are always needed, such as warnings (-w) and directory inclusion (-J.), are added outside of the conditionals.
Debug Flags:
For DMD: When debugging is enabled (DEBUG=yes), the -debug flag for including debug code and -gs for generating standalone debug symbols are added.
For LDC or other compilers: -d-debug for debugging and -gc for generating debugging information are added similarly when debugging is enabled.
Optimization Flag:
The -O flag is only added when debugging is not enabled. This ensures that the program is compiled with optimizations only when it is not in debug mode.
  • Loading branch information
abraunegg committed Apr 8, 2024
1 parent a28fe92 commit c680c75
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,18 @@ DEBUG = @DEBUG@
DC = @DC@
DC_TYPE = @DC_TYPE@
DCFLAGS = @DCFLAGS@
DCFLAGS += -w -g -O -J.
DCFLAGS += -w -J.
ifeq ($(DEBUG),yes)
ifeq ($(DC_TYPE),dmd)
DCFLAGS += -debug -gs
# Add DMD Debugging Flags
DCFLAGS += -g -debug -gs
else
DCFLAGS += -d-debug -gc
# Add LDC Debuggging Flags
DCFLAGS += -g -d-debug -gc
endif
else
# Only add optimisation flags if debugging is not enabled
DCFLAGS += -O
endif

ifeq ($(NOTIFICATIONS),yes)
Expand Down

0 comments on commit c680c75

Please sign in to comment.