# HG changeset patch # User Matti Hamalainen # Date 1634565482 -10800 # Node ID 71f04d8e791edeaf8ab32480ae7169757a10ca7b # Parent b76ac594cf3359244d592a12b4082145349488fb Implement a simple shell script for finding C64 chargen ROM image file (if any can be found) for *NIX builds and note the existence of the DM_DEF_CHARGEN define in MinGW Makefile with an example. diff -r b76ac594cf33 -r 71f04d8e791e Makefile --- a/Makefile Mon Oct 18 15:42:14 2021 +0300 +++ b/Makefile Mon Oct 18 16:58:02 2021 +0300 @@ -23,6 +23,8 @@ ZLIB_CFLAGS ?= $(shell pkg-config --cflags zlib) ZLIB_LDFLAGS ?= $(shell pkg-config --libs zlib) +FINDCHARGEN := $(shell sh $(DMLIB)/tools/findchargen.sh) +CFLAGS += $(FINDCHARGEN) TOOL_LDFLAGS ?= diff -r b76ac594cf33 -r 71f04d8e791e Makefile.cross-mingw --- a/Makefile.cross-mingw Mon Oct 18 15:42:14 2021 +0300 +++ b/Makefile.cross-mingw Mon Oct 18 16:58:02 2021 +0300 @@ -14,6 +14,13 @@ # make -f Makefile.cross-mingw MINGW=64 BINTOOL_PREFIX=foo-bar-zoo # +# NOTE! If you want to define the default path for C64 chargen +# ROM image file, you can set it with this define. Do take note of +# the somewhat peculiar quotation and escape of backlash '\', these +# are REQUIRED. +CFLAGS += -DDM_DEF_CHARGEN='"C:\\VICE-3.5\\C64\\chargen"' + + ifeq ($(MINGW),64) BINTOOL_PREFIX ?= x86_64-w64-mingw32- MINGW_SYS_PATH ?= /usr/x86_64-w64-mingw32 diff -r b76ac594cf33 -r 71f04d8e791e tools/findchargen.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/findchargen.sh Mon Oct 18 16:58:02 2021 +0300 @@ -0,0 +1,18 @@ +#!/bin/sh +### +### Simple script to find C64 chargen ROM image file +### +IFOUND="" +for IROOT in /usr /usr/local /opt; do + for IBASE in /lib /lib64 /share; do + IPATH="${IROOT}/${IBASE}/vice/C64/chargen" + if test -e "$IPATH"; then + IFOUND="$IPATH" + fi + done +done + +# Echo the define if found +if test -n "$IFOUND"; then + echo "-DDM_DEF_CHARGEN=\\\"${IFOUND}\\\"" +fi