#!/bin/sh
#
# libslack - https://libslack.org
#
# Copyright (C) 1999-2004, 2010, 2020-2023 raf <raf@raf.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# 20230824 raf <raf@raf.org>
#

# Modify Makefile to use $CC as CC

if [ "x$CC" != x ]
then
	perl -pi \
		-e 's/^(CC := cc)$/# $1/;' \
		-e 's/^(CC := gcc)$/# $1/;' \
		-e 's,^# (CC := .*other)$,CC := '"$CC"' # other,;' \
		`find . -name Makefile`
fi

# vi:set ts=4 sw=4:
