Shall not pass 80 characters in width.
This commit is contained in:
@@ -15,16 +15,28 @@ endif
|
||||
CC = clang
|
||||
|
||||
UFLAGS =
|
||||
FLAGS = -ansi -D_POSIX_C_SOURCE=200809L -pedantic -pedantic-errors -Wall -Wextra -fno-caret-diagnostics -fno-show-column -Wno-missing-field-initializers -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable
|
||||
# -pedantic-errors
|
||||
# NOTE: We comply with C89 (plain C), however the standard has no 64-bit
|
||||
# support. But, every compiler at that time supported long long,
|
||||
# hence we ignore the incompliance in our code.
|
||||
# NOTE: We allow function declrations with specifying void
|
||||
# (ex, void test() is allowed).
|
||||
FLAGS = -ansi -pedantic -pedantic-errors -Wno-long-long \
|
||||
-Wno-strict-prototypes -Wall -Wextra -fno-caret-diagnostics \
|
||||
-fno-show-column -Wno-missing-field-initializers \
|
||||
-Wno-unused-function -Wno-unused-parameter -Wno-unused-variable \
|
||||
-Wno-unused-but-set-variable
|
||||
|
||||
ifeq ($(DETECTED_OS),macos)
|
||||
UFLAGS = -gldb
|
||||
UFLAGS = -glldb
|
||||
INCLUDE = -I./sdl/include/
|
||||
LIBS = ./sdl/lib/arm-macos/libSDL2.a -lm
|
||||
FRAMEWORKS = -framework Cocoa -framework IOKit -framework CoreAudio -framework AudioToolbox -framework ForceFeedback -framework Carbon -framework GameController -framework Metal -framework QuartzCore -framework CoreHaptics
|
||||
FRAMEWORKS = -framework Cocoa -framework IOKit -framework CoreAudio \
|
||||
-framework AudioToolbox -framework ForceFeedback \
|
||||
-framework Carbon -framework GameController \
|
||||
-framework Metal -framework QuartzCore \
|
||||
-framework CoreHaptics
|
||||
else ifeq ($(DETECTED_OS),linux)
|
||||
UFLAGS = -ggdb
|
||||
UFLAGS = -ggdb -D_POSIX_C_SOURCE=200809L
|
||||
INCLUDE = -I./sdl/include/
|
||||
LIBS = ./sdl/lib/x86_64-linux/libSDL2.a -lm -lX11
|
||||
FRAMEWORKS =
|
||||
@@ -43,10 +55,12 @@ EXE=handmadehero
|
||||
default: libhandmade $(EXE)
|
||||
|
||||
libhandmade: handmade.c
|
||||
@ $(CC) $(FLAGS) $(UFLAGS) -fPIC -shared $(INCLUDE) $^ $(LIBS) $(FRAMEWORKS) -o libhandmade.so
|
||||
@ $(CC) $(FLAGS) $(UFLAGS) -fPIC -shared $(INCLUDE) $^ $(LIBS) \
|
||||
$(FRAMEWORKS) -o libhandmade.so
|
||||
|
||||
$(EXE): sdl_handmade.c libhandmade
|
||||
@ $(CC) $(FLAGS) $(UFLAGS) $(INCLUDE) sdl_handmade.c $(LIBS) $(FRAMEWORKS) -o $@
|
||||
@ $(CC) $(FLAGS) $(UFLAGS) $(INCLUDE) sdl_handmade.c $(LIBS) \
|
||||
$(FRAMEWORKS) -o $@
|
||||
|
||||
run:
|
||||
./$(EXE)
|
||||
|
||||
Reference in New Issue
Block a user