2024-07-17 21:38:27 -04:00
|
|
|
# Base compiler flags. Only change if you *explicitly* know what you're doing.
|
2024-07-19 03:59:19 -04:00
|
|
|
|
2024-07-19 05:10:10 -04:00
|
|
|
CXXRTDIR = $(VCDIR)/crt
|
|
|
|
UCRTDIR = $(VCDIR)/ucrt
|
|
|
|
PSDKDIR = $(VCDIR)/winsdk
|
2024-07-19 03:59:19 -04:00
|
|
|
|
2024-07-19 05:10:10 -04:00
|
|
|
Release_RTLIBS = libcmt.lib libucrt.lib libvcruntime.lib libcpmt.lib
|
|
|
|
Debug_RTLIBS = libcmtd.lib libucrtd.lib libvcruntimed.lib libcpmtd.lib
|
|
|
|
|
|
|
|
# I really should rename this x_x
|
|
|
|
CLANG_FLAGS = -fms-extensions -fms-compatibility-version=19 -isystem $(CXXRTDIR)/include -isystem $(UCRTDIR)/include -isystem $(PSDKDIR)/include/shared -isystem $(PSDKDIR)/include/um
|
|
|
|
|
2024-07-19 07:45:18 -04:00
|
|
|
BASE_FLAGS = -MMD -gcodeview -fvisibility=hidden $(CLANG_FLAGS) -march=pentium-mmx -Iinclude -Isrc -Ithird_party -mstack-alignment=4 -D_WIN32_WINNT=0x0501
|
2024-07-19 03:59:19 -04:00
|
|
|
|
|
|
|
BASE_CCFLAGS = $(BASE_FLAGS) -std=gnu17
|
|
|
|
BASE_CXXFLAGS = $(BASE_FLAGS) -std=c++20
|
2024-07-19 05:10:10 -04:00
|
|
|
BASE_LDFLAGS_SHARED = /dll
|
|
|
|
|
2024-07-19 07:45:18 -04:00
|
|
|
BASE_LDFLAGS = /nodefaultlib /version:5.1 /machine:i386 /subsystem:windows,5.1 /libpath:$(CXXRTDIR)/lib/x86 /libpath:$(UCRTDIR)/lib /libpath:$(PSDKDIR)/lib
|
2024-07-17 21:38:27 -04:00
|
|
|
|
2024-07-19 07:45:18 -04:00
|
|
|
# TODO: Figure out what optimizations are safe and don't break the stack
|
2024-07-17 21:38:27 -04:00
|
|
|
Release_Valid = yes
|
2024-07-19 07:45:18 -04:00
|
|
|
Release_CCFLAGS = -O0 -DNDEBUG
|
|
|
|
Release_CXXFLAGS = -O0 -DNDEBUG
|
2024-07-19 05:10:10 -04:00
|
|
|
Release_LDFLAGS = /debug /pdb:$(BINDIR)/$(NAME).pdb
|
2024-07-17 21:38:27 -04:00
|
|
|
|
|
|
|
Debug_Valid = yes
|
2024-07-19 07:45:18 -04:00
|
|
|
Debug_CCFLAGS = -O0 -DDEBUG # -D_DEBUG
|
|
|
|
Debug_CXXFLAGS = -O0 -DDEBUG # -D_DEBUG -D_ITERATOR_DEBUG_LEVEL=0
|
2024-07-19 05:10:10 -04:00
|
|
|
Debug_LDFLAGS = /debug /pdb:$(BINDIR)/$(NAME).pdb
|
2024-07-17 21:38:27 -04:00
|
|
|
|
|
|
|
# select a default configuration or validate configuration
|
|
|
|
ifeq ($(CONFIG),)
|
|
|
|
CONFIG = Release
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($($(CONFIG)_Valid),yes)
|
|
|
|
$(error Please select a valid configuration)
|
|
|
|
endif
|
2024-07-19 03:59:19 -04:00
|
|
|
|
|
|
|
# define the directories used for output products here.
|
|
|
|
BINDIR = bin/$(ARCH)/$(CONFIG)
|
|
|
|
OBJDIR = obj/$(ARCH)/$(CONFIG)
|