Skip to content

Commit

Permalink
Allow static linking from Makefile via STATIC=1
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamlayers committed Nov 18, 2022
1 parent cb49ff2 commit 59d579f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ SOURCES := acidwarp.c palinit.c rolnfade.c display.c
IMGGEN_SOURCES := bit_map.c lut.c img_int.c img_float.c
OBJECTS = $(SOURCES:%.c=%.o)

ifeq ($(STATIC),1)
CFLAGS += -DGLEW_STATIC -static
endif

ifeq ($(GL),1)
# OpenGL ES / WebGL builds require SDL 2
SDL := 2
Expand Down Expand Up @@ -57,7 +61,11 @@ SOURCES += acid_ico.c
endif

CFLAGS += $(shell $(SDL_CONFIG) --cflags)
ifeq ($(STATIC),1)
LIBS := $(shell $(SDL_CONFIG) --static-libs) -lm
else
LIBS := $(shell $(SDL_CONFIG) --libs) -lm
endif
ifeq ($(GL),1)
ifeq ($(PLATFORM),Darwin)
LIBS += -framework OpenGL
Expand Down

0 comments on commit 59d579f

Please sign in to comment.