mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[build] Clean the windows targets
This commit is contained in:
committed by
EmilieNumworks
parent
652a44c844
commit
657a6da583
42
Makefile
42
Makefile
@@ -172,46 +172,8 @@ default: $(DEFAULT)
|
|||||||
|
|
||||||
$(foreach extension,$(extensions),$(foreach executable,$(executables),$(eval $(call rules_for_targets,$(executable),$(extension)))))
|
$(foreach extension,$(extensions),$(foreach executable,$(executables),$(eval $(call rules_for_targets,$(executable),$(extension)))))
|
||||||
|
|
||||||
# Define standard compilation rules
|
# Load standard build rules
|
||||||
|
include build/rules.mk
|
||||||
$(eval $(call rule_for, \
|
|
||||||
AS, %.o, %.s, \
|
|
||||||
$$(CC) $$(SFLAGS) -c $$< -o $$@ \
|
|
||||||
))
|
|
||||||
|
|
||||||
$(eval $(call rule_for, \
|
|
||||||
CC, %.o, %.c, \
|
|
||||||
$$(CC) $$(SFLAGS) $$(CFLAGS) -c $$< -o $$@, \
|
|
||||||
with_local_version \
|
|
||||||
))
|
|
||||||
|
|
||||||
$(eval $(call rule_for, \
|
|
||||||
CXX, %.o, %.cpp, \
|
|
||||||
$$(CXX) $$(SFLAGS) $$(CXXFLAGS) -c $$< -o $$@, \
|
|
||||||
with_local_version \
|
|
||||||
))
|
|
||||||
|
|
||||||
$(eval $(call rule_for, \
|
|
||||||
OCC, %.o, %.m, \
|
|
||||||
$$(CC) $$(SFLAGS) $$(CFLAGS) -c $$< -o $$@ \
|
|
||||||
))
|
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
|
||||||
# Work around command-line length limit
|
|
||||||
# On Msys2 the max command line is 32 000 characters. Our standard LD command
|
|
||||||
# can be longer than that because we have quite a lot of object files. To work
|
|
||||||
# around this issue, we write the object list in a "target.objs" file, and tell
|
|
||||||
# the linker to read its arguments from this file.
|
|
||||||
$(eval $(call rule_for, \
|
|
||||||
LD, %.$$(EXE), , \
|
|
||||||
echo $$^ > $$@.objs && $$(LD) @$$@.objs $$(LDFLAGS) -o $$@ && rm $$@.objs \
|
|
||||||
))
|
|
||||||
else
|
|
||||||
$(eval $(call rule_for, \
|
|
||||||
LD, %.$$(EXE), , \
|
|
||||||
$$(LD) $$^ $$(LDFLAGS) -o $$@ \
|
|
||||||
))
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY: workshop_python_emulator
|
.PHONY: workshop_python_emulator
|
||||||
workshop_python_emulator:
|
workshop_python_emulator:
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
TOOLCHAIN ?= windows
|
TOOLCHAIN = windows
|
||||||
EXE = exe
|
EXE = exe
|
||||||
|
|||||||
45
build/rules.mk
Normal file
45
build/rules.mk
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# Define standard compilation rules
|
||||||
|
|
||||||
|
$(eval $(call rule_for, \
|
||||||
|
AS, %.o, %.s, \
|
||||||
|
$$(CC) $$(SFLAGS) -c $$< -o $$@ \
|
||||||
|
))
|
||||||
|
|
||||||
|
$(eval $(call rule_for, \
|
||||||
|
CC, %.o, %.c, \
|
||||||
|
$$(CC) $$(SFLAGS) $$(CFLAGS) -c $$< -o $$@, \
|
||||||
|
with_local_version \
|
||||||
|
))
|
||||||
|
|
||||||
|
$(eval $(call rule_for, \
|
||||||
|
CXX, %.o, %.cpp, \
|
||||||
|
$$(CXX) $$(SFLAGS) $$(CXXFLAGS) -c $$< -o $$@, \
|
||||||
|
with_local_version \
|
||||||
|
))
|
||||||
|
|
||||||
|
$(eval $(call rule_for, \
|
||||||
|
OCC, %.o, %.m, \
|
||||||
|
$$(CC) $$(SFLAGS) $$(CFLAGS) -c $$< -o $$@ \
|
||||||
|
))
|
||||||
|
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
# Work around command-line length limit
|
||||||
|
# On Msys2 the max command line is 32 000 characters. Our standard LD command
|
||||||
|
# can be longer than that because we have quite a lot of object files. To work
|
||||||
|
# around this issue, we write the object list in a "target.objs" file, and tell
|
||||||
|
# the linker to read its arguments from this file.
|
||||||
|
$(eval $(call rule_for, \
|
||||||
|
LD, %.$$(EXE), , \
|
||||||
|
echo $$^ > $$@.objs && $$(LD) @$$@.objs $$(LDFLAGS) -o $$@ && rm $$@.objs \
|
||||||
|
))
|
||||||
|
else
|
||||||
|
$(eval $(call rule_for, \
|
||||||
|
LD, %.$$(EXE), , \
|
||||||
|
$$(LD) $$^ $$(LDFLAGS) -o $$@ \
|
||||||
|
))
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(eval $(call rule_for, \
|
||||||
|
WINDRES, %.o, %.rc, \
|
||||||
|
$$(WINDRES) $$< -O coff -o $$@ \
|
||||||
|
))
|
||||||
@@ -1 +0,0 @@
|
|||||||
-include build/targets.sdl.$(MODEL).mak
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
$(eval $(call rule_for, \
|
|
||||||
WINDRES, %.o, %.rc, \
|
|
||||||
$$(WINDRES) $$< -O coff -o $$@ \
|
|
||||||
))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
CC = gcc
|
|
||||||
CXX = g++
|
|
||||||
LD = g++
|
|
||||||
EXE = exe
|
|
||||||
|
|
||||||
SFLAGS += -D_USE_MATH_DEFINES
|
|
||||||
LDFLAGS += -static -mwindows
|
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
CC = x86_64-w64-mingw32-gcc
|
ifeq ($(OS),Windows_NT)
|
||||||
CXX = x86_64-w64-mingw32-g++
|
MINGW_TOOLCHAIN_PREFIX=
|
||||||
LD = x86_64-w64-mingw32-g++
|
else
|
||||||
EXE = exe
|
MINGW_TOOLCHAIN_PREFIX=x86_64-w64-mingw32-
|
||||||
|
endif
|
||||||
|
|
||||||
|
CC = $(MINGW_TOOLCHAIN_PREFIX)gcc
|
||||||
|
CXX = $(MINGW_TOOLCHAIN_PREFIX)g++
|
||||||
|
LD = $(MINGW_TOOLCHAIN_PREFIX)g++
|
||||||
|
WINDRES = $(MINGW_TOOLCHAIN_PREFIX)windres
|
||||||
|
|
||||||
SFLAGS += -D_USE_MATH_DEFINES
|
SFLAGS += -D_USE_MATH_DEFINES
|
||||||
LDFLAGS += -static
|
LDFLAGS += -static
|
||||||
@@ -12,5 +18,3 @@ ifeq ($(DEBUG),0)
|
|||||||
# downside of not defining "-mwindows" is that you lose stdout and stderr.
|
# downside of not defining "-mwindows" is that you lose stdout and stderr.
|
||||||
LDFLAGS += -mwindows
|
LDFLAGS += -mwindows
|
||||||
endif
|
endif
|
||||||
|
|
||||||
WINDRES = x86_64-w64-mingw32-windres
|
|
||||||
|
|||||||
Reference in New Issue
Block a user