File:  [Isaki's NoNo m68k/m88k emulator] / nono / Makefile.rule
Revision 1.1.1.5 (vendor branch): download - view: text, annotated - select for diffs
Wed Apr 29 17:05:47 2026 UTC (2 months, 3 weeks ago) by root
Branches: MAIN, Isaki
CVS tags: v027, v026, v025, HEAD
nono 1.5.0

#
# nono
# Copyright (C) 2020 nono project
# Licensed under nono-license.txt
#

# 共通のルール。
# サブディレクトリの Makefile の末尾で .include すること。

# 必要に応じて以下の変数を定義しておく。
#
# TARGETS
#	ターゲット。複数でもよい。
#	ターゲットをビルドするためのルールは各自で定義のこと。
#
# CSRCS
#	nono をビルドするための C ソース。
#
# CSRCS_all
#	テストなども含むすべてのターゲットをビルドするための C ソース。
#	定義されてなければこちらで ${CSRCS} を代入する。
#
# CXXSRCS
#	nono をビルドするための C++ ソース。
#
# CXXSRCS_all
#	テストなども含むすべてのターゲットをビルドするための C++ ソース。
#	定義されてなければこちらで ${CXXSRCS} を代入する。
#
# CFLAGS.{srcfile}
# CXXFLAGS.{srcfile}
# CPPFLAGS.{srcfile}
#	個別のソースファイルに適用するオプション。
#
# COPT
#	C/C++ ソースコンパイル時に指定する追加のオプション。
#	すべてのオプションより後ろで出力する。
#
# CLEANFILES
#	make clean で削除する追加のファイル。
#
# CLEANDIRFILES
#	make cleandir で削除する追加のファイル。

CSRCS_all?=		${CSRCS}
CXXSRCS_all?=	${CXXSRCS}

all:	${TARGETS}

.PHONY: clean
clean:
	rm -rf ${TARGETS} *.o ${CLEANFILES}

.PHONY: cleandir
cleandir:
	rm -rf .depends ${CLEANDIRFILES}

.PHONY: install
install:

.PHONY: depend
.if "${CSRCS_all}" != "" || "${CXXSRCS_all}" != ""
.PHONY: ${CSRCS_all:.c=.d} ${CXXSRCS_all:.cpp=.d}
depend: ${CSRCS_all:.c=.d} ${CXXSRCS_all:.cpp=.d}
	cat ${.ALLSRC} > .depends
	rm -f *.d
.endif

.for f in ${CSRCS_all}
${f:.c=.d}:
	${CC} ${CPPFLAGS} -E -MM $f > $@
.endfor
.for f in ${CXXSRCS_all}
${f:.cpp=.d}:
	${CXX} ${CPPFLAGS} -E -MM $f > $@
.endfor

.if exists(${.CURDIR}/.depends)
.include "${.CURDIR}/.depends"
.endif

.PHONY: show-files
show-files:
	@echo ${CSRCS} ${CXXSRCS}

.PHONY:	show-allfiles
show-allfiles:
	@echo ${CSRCS_all} ${CXXSRCS_all}

.c.o:
	${CC}  ${CFLAGS}   ${CFLAGS.$<}   ${CPPFLAGS} ${CPPFLAGS.$<} ${COPT} -c $< -o $@

.cpp.o:
	${CXX} ${CXXFLAGS} ${CXXFLAGS.$<} ${CPPFLAGS} ${CPPFLAGS.$<} ${COPT} -c $< -o $@

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.