-
-
Notifications
You must be signed in to change notification settings - Fork 30
Update linux makefiles to 1) use libbsd-overlay and 2) isolate common code from linux makefiles into included makefiles. And update Cmakelists to use libbsd-overlay package in case of Linux; Update Cmakelists to include an install target similar to that used in the makefiles. #542
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 all commits
c821a73
97b84d4
e130b0f
f4021ef
fcbcb2c
41cad3e
dadbef4
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,15 @@ | ||
| # Common Options for All Linuxes | ||
|
|
||
| CC = gcc $(GCC_CFLAGS) | ||
| # CC = clang $(CLANG_CFLAGS) | ||
|
|
||
| include linux-libbsd.mk | ||
|
|
||
| # OPTFLAGS is normally -O2. | ||
| OPTFLAGS = -O2 -g3 | ||
| DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) $(BSD_CFLAGS) $(ADDITIONAL_DFLAGS) | ||
|
|
||
| LDFLAGS = $(XLDFLAGS) -lc -lm $(BSD_LDFLAGS) | ||
| LDELDFLAGS = $(XLDFLAGS) -lc -lm $(BSD_LDFLAGS) | ||
|
|
||
| OBJECTDIR = ../$(RELEASENAME)/ |
| 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) | ||
|
Collaborator
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. On online.interlisp.org, this fails with: This may be a case where |
||
| 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 | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Common Options for Linux with X Windows | ||
|
|
||
| XFILES = $(OBJECTDIR)xmkicon.o \ | ||
| $(OBJECTDIR)xbbt.o \ | ||
| $(OBJECTDIR)dspif.o \ | ||
| $(OBJECTDIR)xinit.o \ | ||
| $(OBJECTDIR)xscroll.o \ | ||
| $(OBJECTDIR)xcursor.o \ | ||
| $(OBJECTDIR)xlspwin.o \ | ||
| $(OBJECTDIR)xrdopt.o \ | ||
| $(OBJECTDIR)xwinman.o | ||
|
|
||
|
|
||
| XFLAGS = -DXWINDOW | ||
|
|
||
| XLDFLAGS = -L/usr/X11/lib -lX11 | ||
|
|
||
|
Collaborator
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. One thing I'd note is that we require libx11 version 1.7.0 or later, since we're using |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,12 @@ | ||
| # Options for Linux, aarch64 processor, X windows, for INIT processing | ||
|
|
||
| CC = gcc $(GCC_CFLAGS) | ||
| #CC = clang $(CLANG_CFLAGS) | ||
| include linux-x.mk | ||
|
|
||
| XFILES = $(OBJECTDIR)xmkicon.o \ | ||
| $(OBJECTDIR)xbbt.o \ | ||
| $(OBJECTDIR)dspif.o \ | ||
| $(OBJECTDIR)xinit.o \ | ||
| $(OBJECTDIR)xscroll.o \ | ||
| $(OBJECTDIR)xcursor.o \ | ||
| $(OBJECTDIR)xlspwin.o \ | ||
| $(OBJECTDIR)xrdopt.o \ | ||
| $(OBJECTDIR)xwinman.o | ||
|
|
||
|
|
||
| XFLAGS = -DXWINDOW | ||
|
|
||
| # OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it | ||
| OPTFLAGS = -O0 -g | ||
| DEBUGFLAGS = | ||
| DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT | ||
| ADDITIONAL_DFLAGS = $(DEBUGFLAGS) -DNOVERSION -DINIT | ||
|
|
||
| LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm | ||
| LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm | ||
| include linux-common.mk | ||
|
|
||
| OBJECTDIR = ../$(RELEASENAME)/ | ||
| OPTFLAGS = -O0 -g | ||
|
|
||
| default : ../$(OSARCHNAME)/ldeinit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,12 @@ | ||
| # Options for Linux, x86 processor, X windows, for INIT processing | ||
|
|
||
| CC = gcc $(GCC_CFLAGS) | ||
| #CC = clang $(CLANG_CFLAGS) | ||
| include linux-x.mk | ||
|
|
||
| XFILES = $(OBJECTDIR)xmkicon.o \ | ||
| $(OBJECTDIR)xbbt.o \ | ||
| $(OBJECTDIR)dspif.o \ | ||
| $(OBJECTDIR)xinit.o \ | ||
| $(OBJECTDIR)xscroll.o \ | ||
| $(OBJECTDIR)xcursor.o \ | ||
| $(OBJECTDIR)xlspwin.o \ | ||
| $(OBJECTDIR)xrdopt.o \ | ||
| $(OBJECTDIR)xwinman.o | ||
|
|
||
|
|
||
| XFLAGS = -DXWINDOW | ||
|
|
||
| # OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it | ||
| OPTFLAGS = -O0 -g | ||
| DEBUGFLAGS = | ||
| DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT | ||
| ADDITIONAL_DFLAGS = $(DEBUGFLAGS) -DNOVERSION -DINIT | ||
|
|
||
| LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm | ||
| LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm | ||
| include linux-common.mk | ||
|
|
||
| OBJECTDIR = ../$(RELEASENAME)/ | ||
| OPTFLAGS = -O0 -g | ||
|
|
||
| default : ../$(OSARCHNAME)/ldeinit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,10 @@ | ||
| # Options for Linux, Intel 386/486 and SDL | ||
|
|
||
| CC = gcc -m32 $(GCC_CFLAGS) | ||
| # CC = clang $(CLANG_CFLAGS) | ||
| GCC_CFLAGS := -m64 $(GCC_CFLAGS) | ||
| CLANG_CFLAGS := -m64 $(CLANG_CFLAGS) | ||
|
fghalasz marked this conversation as resolved.
|
||
|
|
||
| XFILES = $(OBJECTDIR)sdl.o | ||
| include linux-sdl.mk | ||
|
|
||
| # | ||
| # 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 | ||
|
|
||
| # OPTFLAGS is normally -O2. | ||
| OPTFLAGS = -O2 -g3 | ||
| DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) | ||
|
|
||
| LDFLAGS = -lm -lSDL2 | ||
| LDELDFLAGS = | ||
|
|
||
| OBJECTDIR = ../$(RELEASENAME)/ | ||
| include linux-common.mk | ||
|
|
||
| default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,10 @@ | ||
| # Options for Linux, Intel 386/486 and X-Window | ||
|
|
||
| CC = gcc -m32 $(GCC_CFLAGS) | ||
| # CC = clang -m32 $(CLANG_CFLAGS) | ||
| GCC_CFLAGS := -m32 $(GCC_CFLAGS) | ||
| CLANG_CFLAGS := -m32 $(CLANG_CFLAGS) | ||
|
|
||
| XFILES = $(OBJECTDIR)xmkicon.o \ | ||
| $(OBJECTDIR)xbbt.o \ | ||
| $(OBJECTDIR)dspif.o \ | ||
| $(OBJECTDIR)xinit.o \ | ||
| $(OBJECTDIR)xscroll.o \ | ||
| $(OBJECTDIR)xcursor.o \ | ||
| $(OBJECTDIR)xlspwin.o \ | ||
| $(OBJECTDIR)xrdopt.o \ | ||
| $(OBJECTDIR)xwinman.o | ||
| include linux-x.mk | ||
|
|
||
| XFLAGS = -DXWINDOW | ||
|
|
||
| # OPTFLAGS is normally -O2. | ||
| OPTFLAGS = -O2 -g3 | ||
| DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) | ||
|
|
||
| LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm | ||
| LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm | ||
|
|
||
| OBJECTDIR = ../$(RELEASENAME)/ | ||
| include linux-common.mk | ||
|
|
||
| default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,7 @@ | ||
| # Options for Linux, ARM64 and SDL | ||
|
|
||
| CC = gcc $(GCC_CFLAGS) | ||
| #CC = clang $(CLANG_CFLAGS) | ||
| include linux-sdl.mk | ||
|
|
||
| XFILES = $(OBJECTDIR)sdl.o | ||
|
|
||
| # | ||
| # For SDL version 2 | ||
| # -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS | ||
| # For SDL version 3 | ||
| # -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS | ||
| # | ||
| SDLFLAGS = -DSDL=2 | ||
|
|
||
| # OPTFLAGS is normally -O2. | ||
| OPTFLAGS = -O2 -g3 | ||
| DFLAGS = $(SDLFLAGS) -DRELEASE=$(RELEASE) | ||
|
|
||
| LDFLAGS = -lSDL2 -lm | ||
| LDELDFLAGS = | ||
|
|
||
| OBJECTDIR = ../$(RELEASENAME)/ | ||
| include linux-common.mk | ||
|
|
||
| default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,7 @@ | ||
| # Options for Linux, aarch64 and X-Window | ||
|
|
||
| CC = gcc $(GCC_CFLAGS) | ||
| #CC = clang $(CLANG_CFLAGS) | ||
| include linux-x.mk | ||
|
|
||
| XFILES = $(OBJECTDIR)xmkicon.o \ | ||
| $(OBJECTDIR)xbbt.o \ | ||
| $(OBJECTDIR)dspif.o \ | ||
| $(OBJECTDIR)xinit.o \ | ||
| $(OBJECTDIR)xscroll.o \ | ||
| $(OBJECTDIR)xcursor.o \ | ||
| $(OBJECTDIR)xlspwin.o \ | ||
| $(OBJECTDIR)xrdopt.o \ | ||
| $(OBJECTDIR)xwinman.o | ||
|
|
||
| XFLAGS = -DXWINDOW | ||
|
|
||
| # OPTFLAGS is normally -O2. | ||
| OPTFLAGS = -O2 -g3 | ||
| DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) | ||
|
|
||
| LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm | ||
| LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm | ||
|
|
||
| OBJECTDIR = ../$(RELEASENAME)/ | ||
| include linux-common.mk | ||
|
|
||
| default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldex |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,7 @@ | ||
| # Options for Linux, ARMv7 and SDL | ||
|
|
||
| CC = gcc $(GCC_CFLAGS) | ||
| #CC = clang $(CLANG_CFLAGS) | ||
| include linux-sdl.mk | ||
|
|
||
| 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 | ||
|
|
||
| # OPTFLAGS is normally -O2. | ||
| OPTFLAGS = -O2 -g3 | ||
| DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) | ||
|
|
||
| LDFLAGS = -lm -lSDL2 | ||
| LDELDFLAGS = | ||
|
|
||
| OBJECTDIR = ../$(RELEASENAME)/ | ||
| include linux-common.mk | ||
|
|
||
| default : ../$(OSARCHNAME)/lde ../$(OSARCHNAME)/ldesdl |
Uh oh!
There was an error while loading. Please reload this page.