From 8b7e9eca1043b8f41168cb14dba1d7955928f010 Mon Sep 17 00:00:00 2001 From: piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> Date: Sat, 14 Apr 2012 08:44:13 +0000 Subject: Fix makefile when using pmake. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5641 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/Makefile | 10 ++++++---- pttbbs/pttbbs.mk | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pttbbs/mbbsd/Makefile b/pttbbs/mbbsd/Makefile index 8c196d26..9cfe7e14 100644 --- a/pttbbs/mbbsd/Makefile +++ b/pttbbs/mbbsd/Makefile @@ -53,10 +53,12 @@ LDLIBS+= -lcmbbs -lcmsys -losdep BBSCONF:= $(SRCROOT)/pttbbs.conf DEF_PATTERN:= ^[ \t]*\#[ \t]*define[ \t]* -USE_BBSLUA!= sh -c 'grep -Ew "${DEF_PATTERN}USE_BBSLUA" ${BBSCONF} || true' -USE_PFTERM!= sh -c 'grep -Ew "${DEF_PATTERN}USE_PFTERM" ${BBSCONF} || true' -USE_NIOS!= sh -c 'grep -Ew "${DEF_PATTERN}USE_NIOS" ${BBSCONF} || true' -USE_CONVERT!= sh -c 'grep -Ew "${DEF_PATTERN}CONVERT" ${BBSCONF} || true' +DEF_CMD:= grep -Ewq "${DEF_PATTERN}" +DEF_YES:= && echo "YES" || echo "" +USE_BBSLUA!= sh -c '${DEF_CMD}"USE_BBSLUA" ${BBSCONF} ${DEF_YES}' +USE_PFTERM!= sh -c '${DEF_CMD}"USE_PFTERM" ${BBSCONF} ${DEF_YES}' +USE_NIOS!= sh -c '${DEF_CMD}"USE_NIOS" ${BBSCONF} ${DEF_YES}' +USE_CONVERT!= sh -c '${DEF_CMD}"CONVERT" ${BBSCONF} ${DEF_YES}' .if $(USE_BBSLUA) .if $(OSTYPE)=="FreeBSD" diff --git a/pttbbs/pttbbs.mk b/pttbbs/pttbbs.mk index cb50eec1..5701f647 100644 --- a/pttbbs/pttbbs.mk +++ b/pttbbs/pttbbs.mk @@ -11,8 +11,8 @@ OSTYPE!= uname CC:= gcc CXX:= g++ -CLANG!= sh -c 'type clang' -CCACHE!= sh -c 'type ccache' +CLANG!= sh -c 'type clang 2>/dev/null || echo ""' +CCACHE!= sh -c 'type ccache 2>/dev/null || echo ""' .if $(CLANG) CC:= clang -- cgit v1.2.3