Fix compilation on Windows and enable LTO

This commit is contained in:
Ada Gottensträter 2022-03-29 19:20:21 +02:00
parent 77f7331974
commit 332ba1da89

View File

@ -26,9 +26,11 @@ SOURCES = spinsim.c spininterp.c spindebug.c pasmsim.c pasmdebug.c pasmsim2.c pa
ifneq ($(MSYSTEM),MINGW32) ifneq ($(MSYSTEM),MINGW32)
ifneq ($(OS),msys) ifneq ($(OS),msys)
ifneq ($(OS),Windows_NT)
SOURCES += conion.c SOURCES += conion.c
endif endif
endif endif
endif
OBJECTS = $(patsubst %,$(BUILD)/%, $(SOURCES:.c=.o)) OBJECTS = $(patsubst %,$(BUILD)/%, $(SOURCES:.c=.o))
@ -36,7 +38,7 @@ OBJECTS = $(patsubst %,$(BUILD)/%, $(SOURCES:.c=.o))
# commented them out for the time being # commented them out for the time being
#LDFLAGS = -Wl,--relax -Wl,--gc-sections #LDFLAGS = -Wl,--relax -Wl,--gc-sections
LDFLAGS = -lm LDFLAGS = -lm
OPT := -O3 OPT := -O3 -flto -fno-fat-lto-objects
CFLAGS = -c -g -Wall -Wno-format $(OPT) -D LINUX CFLAGS = -c -g -Wall -Wno-format $(OPT) -D LINUX
all: directory $(SOURCES) $(OBJECTS) Makefile all: directory $(SOURCES) $(OBJECTS) Makefile