Skip to content

Commit

Permalink
Improve Makefile variables
Browse files Browse the repository at this point in the history
  • Loading branch information
TurkeyMcMac committed Apr 9, 2021
1 parent b43e48a commit ca3e9f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
exe = mmmaze
CFLAGS = -std=c89 -pedantic -Wall -Wextra -D_XOPEN_SOURCE
CPPFLAGS = -D_XOPEN_SOURCE
CFLAGS = -std=c89 -pedantic -Wall -Wextra
LDLIBS = -lcurses

CC ?= cc
Expand All @@ -9,7 +10,7 @@ RM ?= rm -f
all: $(exe)

$(exe): src/*
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) src/*.c $(LDLIBS)
$(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) src/*.c $(LDLIBS)

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ It runs on the Windows Console specifically. My procedure to build it using
MingW and PDCurses is as follows:

make -C ../PDCurses/wincon -j CC=x86_64-w64-mingw32-gcc CFLAGS='-I.. -Os -flto' pdcurses.a &&
make exe=mmmaze.exe CC=x86_64-w64-mingw32-gcc CFLAGS='-std=c89 -pedantic -Wall -Wextra -I../PDCurses -Os -flto' LDFLAGS='-Wl,--gc-sections,--strip-all' LDLIBS='../PDCurses/wincon/pdcurses.a'
make exe=mmmaze.exe CC=x86_64-w64-mingw32-gcc CPPFLAGS='-I../PDCurses' CFLAGS='-std=c89 -pedantic -Wall -Wextra -Os -flto' LDFLAGS='-Wl,--gc-sections,--strip-all' LDLIBS='../PDCurses/wincon/pdcurses.a'

(I keep the PDCurses root directory next to this project's root directory on my
computer, which is why the above references `../PDCurses`.)

0 comments on commit ca3e9f4

Please sign in to comment.