-
-
Notifications
You must be signed in to change notification settings - Fork 32
Update cygwin and wsl1 makefiles to use the "Common Linux" scheme from PR#542; Update github workflows to use latest versions of actions #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
c821a73
97b84d4
e130b0f
f4021ef
fcbcb2c
41cad3e
dadbef4
25654fa
07e009c
3430574
c6f3ba4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Common Options for All Linuxes | ||
|
|
||
| include linux-compiler.mk | ||
|
|
||
| ifeq ($(USE_LIBBSD),T) | ||
| include linux-libbsd.mk | ||
| else | ||
| BSD_CFLAGS := | ||
| BSD_LDFLAGS := | ||
| endif | ||
|
|
||
| ifeq ($(USE_DISPLAY),x) | ||
| include linux-x.mk | ||
| DEFAULT_TARGET := ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex | ||
| endif | ||
| ifeq ($(USE_DISPLAY),sdl) | ||
| include linux-sdl.mk | ||
| DEFAULT_TARGET := ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl | ||
| endif | ||
| ifeq ($(USE_DISPLAY),init) | ||
| include linux-x.mk | ||
| DEFAULT_TARGET := ../$(OSARCHNAME)/ldeinit | ||
| endif | ||
|
|
||
| OPTFLAGS ?= -O2 -g3 | ||
| DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) $(BSD_CFLAGS) $(ADDITIONAL_DFLAGS) | ||
|
|
||
| LDFLAGS = $(XLDFLAGS) -lc -lm $(BSD_LDFLAGS) | ||
| LDELDFLAGS = $(XLDFLAGS) -lc -lm $(BSD_LDFLAGS) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| OBJECTDIR = ../$(RELEASENAME)/ | ||
|
|
||
| default: $(DEFAULT_TARGET) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Select whether to use clang or gcc | ||
| # Priority | ||
| # 1. If -DUSE_GCC or -DUSE_CLANG on command line (but not both) use the requested compiler. | ||
| # 2. If one compiler is installed but not the other, use the installed compiler. | ||
| # 3. Use clang | ||
|
|
||
| EXISTS_GCC := $(shell command -v gcc) | ||
| EXISTS_CLANG := $(shell command -v clang) | ||
| ifeq ($(or $(EXISTS_GCC),$(EXISTS_CLANG)),) | ||
| $(error "Cannot find compiler: neither gcc nor clang. Exiting.") | ||
| endif | ||
| ifneq ($(and $(USE_CLANG),$(USE_GCC)),) | ||
| $(error "Cannot use both USE_CLANG=T and USE_GCC=T. Exiting.") | ||
| endif | ||
| COMPILER := | ||
| ifdef USE_CLANG | ||
| ifeq ($(EXISTS_CLANG),) | ||
| $(error "USE_CLANG=T given, but cannot find the clang compiler. Exiting") | ||
| endif | ||
| COMPILER := clang | ||
| endif | ||
| ifdef USE_GCC | ||
| ifeq ($(EXISTS_GCC),) | ||
| $(error "USE_GCC=T given, but cannot find the gcc compiler. Exiting") | ||
| endif | ||
| COMPILER := gcc | ||
| endif | ||
| ifeq ($(COMPILER),) | ||
| ifneq ($(EXISTS_CLANG),) | ||
| COMPILER := clang | ||
| else | ||
| COMPILER := gcc | ||
| endif | ||
| endif | ||
|
|
||
| ifeq ($(COMPILER),gcc) | ||
| CC := gcc $(GCC_CFLAGS) | ||
| else | ||
| CC := clang $(CLANG_CFLAGS) | ||
| endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Check that pkg-config is available and that the libbsd-dev package is installed | ||
| # If one of these is missing, error out | ||
| # FGH 2026-03-08 | ||
| ifneq ($(MAKECMDGOALS),clean) | ||
| ifneq ($(MAKECMDGOALS),cleanup) | ||
|
|
||
| CHK_PKG_CONFIG := $(shell command -v pkg-config) | ||
| ifeq ($(CHK_PKG_CONFIG),) | ||
| # pkg-config not found, print an error | ||
| $(error "pkg-config not found. Please install it to build this project.") | ||
| endif | ||
|
|
||
| CHK_LIBBSD_DEV := $(shell pkg-config --exists libbsd-overlay && echo true) | ||
| ifneq ($(CHK_LIBBSD_DEV),true) | ||
| $(error "libbsd-dev (or libbsd-devel) package not found. Please install it to build this project.") | ||
| endif | ||
| endif | ||
| endif | ||
|
|
||
| BSD_CFLAGS = $(shell pkg-config --cflags libbsd-overlay) | ||
|
|
||
| BSD_LDFLAGS = $(shell pkg-config --libs libbsd-overlay) | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Common Options for Linux using SDL instead of X Windows | ||
|
|
||
| XFILES = $(OBJECTDIR)sdl.o | ||
|
|
||
| # | ||
| # For SDL version 2 | ||
| # -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS | ||
| # For SDL version 3 | ||
| # -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS | ||
| # | ||
| XFLAGS = -DSDL=2 | ||
|
|
||
| XLDFLAGS ?= -lSDL2 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
execute_processcommand uses relative paths like../bin/osversion. This approach is not robust for out-of-source builds, where the build directory is not a direct subdirectory of the source root, and will cause the build to fail in such standard setups. You should use absolute paths constructed withCMAKE_SOURCE_DIRto make the command reliable regardless of the build directory location.