################################################################# ### ### Makefile for Singular ### ################################################################# SHELL = /bin/sh ## ## versions ## SINGULAR_MAJOR_VERSION = @SINGULAR_MAJOR_VERSION@ SINGULAR_MINOR_VERSION = @SINGULAR_MINOR_VERSION@ DIST_NAME = Singular-${SINGULAR_MAJOR_VERSION}.${SINGULAR_MINOR_VERSION} ## ## various paths ## srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ libdir = @libdir@ # program executable goes here bindir = @bindir@ # Singular libs go here singulardatadir = @singulardatadir@ includedir = @includedir@ ## ## various programs ## CC = @CC@ CXX = @CXX@ LEXP = @LEXP@ PERL = @PERL@ BISON = bison @SET_MAKE@ INSTALL = ./install-sh -c INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 MKINSTALLDIRS = ./mkinstalldirs ## ## compiler and linker options ## CFLAGS = @CFLAGS@ -pipe CXXFLAGS = @CXXFLAGS@ -pipe CXXTEMPLFLAGS = @CXXTEMPLFLAGS@ CPPFLAGS = -I${srcdir} @CPPFLAGS@ DEFS = @DEFS@ -DNDEBUG LDFLAGS = @LDFLAGS@ STATIC_LDFLAGS = @STATIC_LDFLAGS@ LIBS = @NEED_LIBS@ ## ## subdirectories ## # where the doumentation files are docdir = doc # where the tests files are testdir = tests ## ## the configuration ## WITH_MP = @WITH_MP@ WITH_FACTORY = @WITH_FACTORY@ WITH_LIBFAC = @WITH_LIBFAC@ WITH_DBM = @WITH_DBM@ DOS_CROSS = @DOS_CROSS@ ## ## End configuration dependend stuff ################################################################# ### ### file sets ### CXXSOURCES=grammar.cc scanner.cc algmap.cc attrib.cc binom.cc clapconv.cc \ clapmem.cc clapsing.cc claptmpl.cc cntrlc.cc \ extra.cc febase.cc feread.cc \ ffields.cc hdegree.cc hilb.cc hutil.cc \ ideals.cc intvec.cc iparith.cc \ ipassign.cc ipconv.cc ipid.cc iplib.cc \ ipprint.cc ipshell.cc khstd.cc kstdfac.cc \ comm.cc kstd1.cc kstd2.cc kutil.cc lists.cc \ longalg.cc longrat.cc \ longrat0.cc maps.cc matpol.cc misc.cc \ mminit.cc modulop.cc \ fglm.cc fglmzero.cc fglmvec.cc fglmgauss.cc fglmhom.cc \ numbers.cc polys.cc polys0.cc polys1.cc polys-impl.cc \ ring.cc shortfl.cc silink.cc sing_mp.cc\ sing_dld.cc sing_dbm.cc spolys.cc spolys0.cc \ subexpr.cc syz.cc syz0.cc syz1.cc \ tesths.cc timer.cc weight.cc \ mpsr_Put.cc mpsr_PutPoly.cc mpsr_Tok.cc mpsr_GetPoly.cc \ mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \ ndbm.cc spSpolyLoop.cc libparse.cc CSOURCES=mmalloc.c mmallocb.c mmallocs.c mmblock.c mmspec.c mmutil.c weight0.c find_exec.c getopt.c SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l libparse.l spSpolyLoop.pl HEADERS=algmap.h hutil.h lists.h stairc.h attrib.h ideals.h \ longalg.h mpsr_Tok.h structs.h binom.h intvec.h longrat.h \ numbers.h stype.h clapconv.h ipconv.h maps.h page.h \ subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \ cntrlc.h ipprint.h mmemory.h ring.h timer.h \ febase.h ipshell.h mmprivat.h shortfl.h tok.h \ ffields.h khstd.h silink.h \ fglm.h comm.h kstd1.h modulop.h sing_dbm.h weight.h \ fglmgauss.h fglmvec.h kstd2.h mpsr.h sing_mp.h \ kstdfac.h mpsr_Get.h spolys.h \ kutil.h mpsr_Put.h spolys0.h \ ndbm.h spSpolyLoop.h polys-impl.h polys-comp.h getopt.h TESTS=${testdir}/comparecheck ${testdir}/fac_test.in ${testdir}/fac_test.out\ ${testdir}/general_test.in ${testdir}/general_test.out \ ${testdir}/mpcheck ${testdir}/mpcheck.data \ ${testdir}/dbm_test.in ${testdir}/dbm_test.out DOCS=${docdir}/Makefile.in ${docdir}/copyright.tex ${docdir}/doc2tex.c \ ${docdir}/examples.doc ${docdir}/examples.tex ${docdir}/proc.tex \ ${docdir}/singular.doc ${docdir}/start.doc \ ${docdir}/start.tex ${docdir}/tutor.tex ${docdir}/singular.tex DISTFILES=${SOURCES} ${HEADERS} Makefile.in configure.in configure \ mod2.h.in grammar.h testgh install-sh mkinstalldirs \ ${TESTS} ${DOCS} OBJS=grammar.o scanner.o matpol.o binom.o\ febase.o feread.o timer.o intvec.o attrib.o lists.o\ longrat.o longrat0.o misc.o ring.o numbers.o maps.o\ hilb.o comm.o kstd1.o kstd2.o kutil.o khstd.o kstdfac.o modulop.o spolys.o\ ideals.o subexpr.o hdegree.o hutil.o ffields.o shortfl.o \ longalg.o spolys0.o syz.o syz0.o syz1.o weight.o weight0.o \ ipid.o ipshell.o iplib.o ipassign.o ipconv.o ipprint.o\ polys.o polys0.o polys1.o polys-impl.o extra.o\ mminit.o mmutil.o mmalloc.o mmallocb.o mmallocs.o \ mmspec.o mmblock.o sing_dld.o sing_dbm.o silink.o \ sing_mp.o fglm.o fglmzero.o fglmvec.o fglmhom.o fglmgauss.o cntrlc.o \ algmap.o clapconv.o clapmem.o clapsing.o claptmpl.o\ mpsr_Error.o mpsr_Put.o mpsr_PutPoly.o mpsr_GetPoly.o \ mpsr_Get.o mpsr_GetMisc.o ndbm.o spSpolyLoop.o libparse.o \ find_exec.o getopt.o ## ## PRIMARY Targets ## .l.cc: @if test "${LEXP}" = touch; then \ touch scanner.cc; \ echo Warning: could not rebuilt scanner.cc;\ else \ echo "${LEXP} -s -I -t $< > scanner.cc"; \ ${LEXP} -s -I -t $< > scanner.cc; \ fi .y.cc: ${BISON} -d -t -o grammar.cc $< chmod +x testgh ./testgh .cc.o: ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} -c $< .c.o: ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $< all: Singular Singular: mod2.h Makefile version.h scanner.cc ${OBJS} iparith.o \ mpsr_Tok.o tesths.cc libparse.cc ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -o Singular \ tesths.cc iparith.o mpsr_Tok.o ${OBJS} ${LDFLAGS} ${LIBS} Singular-static: mod2.h Makefile version.h scanner.cc ${OBJS} iparith.o \ mpsr_Tok.o tesths.cc ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -o Singular-static \ tesths.cc iparith.o mpsr_Tok.o \ ${OBJS} ${STATIC_LDFLAGS} ${LDFLAGS} ${LIBS} iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc claptmpl.o: claptmpl.cc mod2.h ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -c $< iparith.inc mpsr_Tok.inc: iparith.cc ipconv.cc tok.h mpsr_Tok.cc grammar.h mod2.h @if test "${DOS_CROSS}" = yes; then \ echo "NEED TO GENERATE inc FILES -- Please be patient" ;\ cd ..; \ ./configure.dos --generate-inc; \ else \ echo ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -DGENTABLE \ -o gentable iparith.cc tesths.cc mpsr_Tok.cc \ ${OBJS} ${LDFLAGS} ${LIBS};\ ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -DGENTABLE \ -o gentable iparith.cc tesths.cc mpsr_Tok.cc \ ${OBJS} ${LDFLAGS} ${LIBS};\ echo ./gentable; \ ./gentable; \ echo /bin/rm gentable;\ /bin/rm gentable; \ fi version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in configure.in echo "#define SINGULAR_VERSION_ID " `date '+%y%m%d%H'` >version.h mod2.h: stamp-h stamp-h : config.status mod2.h.in CONFIG_FILES= CONFIG_HEADERS=mod2.h ./config.status spSpolyLoop.cc spSpolyLoop.dd : spSpolyLoop.inc spSpolyLoop.inc: spSpolyLoop.pl ${PERL} spSpolyLoop.pl > spSpolyLoop.inc libparse: libparse_main.o utils.o ${CXX} -o libparse libparse_main.o utils.o libparse_main.o: libparse.cc ${CXX} -c -o libparse_main.o libparse.cc -DSTANDALONE_PARSER libparse.cc: libparse.l @if test "${LEXP}" = touch; then \ touch libparse.cc; \ echo Warning: could not rebuilt libparse.cc;\ else \ echo ${LEXP} -I -Pyylp -olibparse.cc libparse.l;\ ${LEXP} -I -Pyylp -olibparse.cc libparse.l;\ fi Makefile: Makefile.in config.status CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status doc/Makefile: doc/Makefile.in config.status CONFIG_FILES="doc/Makefile" CONFIG_HEADERS= ./config.status config.status: configure ./config.status --recheck configure: configure.in @echo "WARNING: You need to rerun autoconf. I am proceeding, for now." @touch configure # autoconf ## ## install targets ## install: all installbin installdata installinfo installbin: Singular ${MKINSTALLDIRS} ${bindir} ${INSTALL_PROGRAM} Singular ${bindir} installdata: ${MKINSTALLDIRS} ${singulardatadir} ${MKINSTALLDIRS} ${singulardatadir}/gftables for file in ${srcdir}/LIB/gftables/[0-9]*; do \ ${INSTALL_DATA} $${file} ${singulardatadir}/gftables; \ done for file in ${srcdir}/LIB/*.lib; do \ ${INSTALL_DATA} $${file} ${singulardatadir}; \ done installinfo: cd ${docdir}; ${MAKE} install uninstall: uninstallbin uninstalldata uninstallinfo uninstallbin: -rm -f ${bindir}/Singular -rmdir ${bindir} uninstalldata: -rm -rf ${singulardatadir}/*.lib ${singulardatadir}/gftables -rmdir ${singulardatadir} unistallinfo: cd ${docdir}; ${MAKE} uninstall ## ## clean targest ## mostlyclean: clean clean: -rm -rf Singular* *.o *.og core *.d *.dd *~ \#* /tmp/mp* \ *.got *dump* *.diff *.dir *.pag cd ${docdir}; ${MAKE} clean distclean: clean -rm -rf depend iparith.inc mpsr_Tok.inc -rm -rf ${DIST_NAME} ${testdir}/out stamp-h -rm mod2.h Makefile TAGS* config.status config.cache config.log cd ${docdir}; ${MAKE} distclean maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "Rebuilding the deleted files requires flex" @echo "bison, perl and autoconf" -rm configure scanner.cc grammar.h grammar.cc libparse.cc spSpolyLoop.inc info dvi ps html: cd ${docdir}; ${MAKE} $@ check: Singular ${testdir}/general_test.in ${testdir}/general_test.out - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \ PATH=`pwd`:${PATH}; export PATH;\ Singular=`pwd`/Singular; export Singular;\ ${testdir}/comparecheck ${testdir}/general_test.in ${testdir}/general_test.out @ if test "${WITH_MP}" = yes; then ${MAKE} mpcheck; fi; @ if test "${WITH_FACTORY}" = yes && test "${WITH_LIBFAC}" = yes; then \ ${MAKE} factorycheck;\ fi @ if test "${WITH_DBM}" = yes; then ${MAKE} dbmcheck; fi mpcheck: Singular ${testdir}/mpcheck ${testdir}/mpcheck.data - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \ PATH=`pwd`:${PATH}; export PATH;\ Singular=`pwd`/Singular; export Singular;\ ${testdir}/mpcheck ${testdir}/mpcheck.data factorycheck: Singular ${testdir}/comparecheck ${testdir}/fac_test.in \ ${testdir}/fac_test.out - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \ PATH=`pwd`:${PATH}; export PATH;\ Singular=`pwd`/Singular; export Singular;\ ${testdir}/comparecheck ${testdir}/fac_test.in ${testdir}/fac_test.out dbmcheck: Singular ${testdir}/comparecheck ${testdir}/dbm_test.in \ ${testdir}/dbm_test.out - @ SINGULARPATH=`pwd`/LIB; export SINGULARPATH; \ PATH=`pwd`:${PATH}; export PATH;\ Singular=`pwd`/Singular; export Singular;\ ${testdir}/comparecheck ${testdir}/dbm_test.in ${testdir}/dbm_test.out ## ## miscellanous targets ## dist: rm -rf ${DISTNAME}.tar* ${TEMPDIR}/${DISTNAME}* mkdir ${TEMPDIR}/${DISTNAME} - cp -pR . ${TEMPDIR}/${DISTNAME} cd ${TEMPDIR}/${DISTNAME}; ${MAKE} distclean; cd ${TEMPDIR}; tar cf ${DISTNAME}.tar ${DISTNAME} rm -rf ${TEMPDIR}/${DISTNAME} - gzip -9 ${TEMPDIR}/${DISTNAME}.tar - mv ${TEMPDIR}/${DISTNAME}.tar.gz . TAGS: etags ${SOURCES} ${HEADERS} ## ## Below here is stuff for developpers ################################################################# ## ## compiler and linker options for debug version ## CCG = gcc CXXG = gcc CXXM = gcc -MM CCM = gcc -MM CFLAGSG = -g -Wall -Wno-unused -pipe CXXFLAGSG = -g -Wall -Wno-unused -pipe CXXTEMPLFLAGSG = -fno-implicit-templates DEFSG = @DEFS@ ## ## .og files for having -O and -g object versions available at the same time ## OBJG1= grammar.og scanner.og matpol.og binom.og\ febase.og feread.og timer.og intvec.og attrib.og lists.og\ longrat.og longrat0.og misc.og ring.og numbers.og maps.og\ hilb.og comm.og kstd1.og kstd2.og kutil.og khstd.og kstdfac.og modulop.og \ spolys.og ideals.og subexpr.og hdegree.og hutil.og ffields.og shortfl.og \ longalg.og spolys0.og syz.og syz0.og syz1.og weight.og \ ipid.og ipshell.og iplib.og ipassign.og ipconv.og ipprint.og\ polys.og polys0.og polys1.og polys-impl.og extra.og\ mminit.og sing_dld.og sing_dbm.og silink.og \ sing_mp.og fglm.og fglmzero.og fglmvec.og fglmgauss.og fglmhom.og\ algmap.og clapconv.og clapmem.og clapsing.og \ cntrlc.og \ mpsr_Error.og mpsr_Put.og mpsr_PutPoly.og mpsr_GetPoly.og \ mpsr_Get.og mpsr_GetMisc.og \ ndbm.og spSpolyLoop.og libparse.og \ OBJG2= mmalloc.og mmallocb.og mmallocs.og mmblock.og \ mmspec.og mmutil.og weight0.og find_exec.og getopt.og OBJG=$(OBJG1) $(OBJG2) claptmpl.og ## ## Debug Targets ## claptmpl.og: claptmpl.cc mod2.h $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ $(OBJG1): %.og: %.cc $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ $(OBJG2): %.og: %.c $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ Singularg: scanner.cc $(OBJG) iparith.og mpsr_Tok.og tesths.cc version.h $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg \ tesths.cc iparith.og mpsr_Tok.og $(OBJG) ${LDFLAGS} ${LIBS} iparith.og: iparith.inc iparith.cc $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c iparith.cc -o iparith.og mpsr_Tok.og: iparith.inc mpsr_Tok.cc $(CXXG) ${CXXFLAGSG} ${CPPFLAGS} ${DEFSG} -c mpsr_Tok.cc -o mpsr_Tok.og installg: Singularg ${MKINSTALLDIRS} ${bindir} ${INSTALL_PROGRAM} Singularg ${bindir} ## ## compiler and linker options for profile version ## CCP = gcc CXXP = gcc CFLAGSP = -pg -O3 -pipe CXXFLAGSP = -pg -O3 -pipe CXXTEMPLFLAGSP = -fno-implicit-templates DEFSP = @DEFS@ -DNDEBUG -DDO_PROFILE LDFLAGSP = -static @LDFLAGS@ CFLAGSB = -g -O3 -pipe CXXFLAGSB = -g -O3 -pipe CXXTEMPLFLAGSB = -fno-implicit-templates DEFSB = @DEFS@ -DNDEBUG LDFLAGSB = -static @LDFLAGS@ # bprof object file to link with BPROFOBJ = /usr/local/lib/bmon.o ## ## .op files for gprof ## OBJP1= grammar.op scanner.op matpol.op binom.op\ febase.op feread.op timer.op intvec.op attrib.op lists.op\ longrat.op longrat0.op misc.op ring.op numbers.op maps.op\ hilb.op comm.op kstd1.op kstd2.op kutil.op khstd.op kstdfac.op modulop.op \ spolys.op ideals.op subexpr.op hdegree.op hutil.op ffields.op shortfl.op \ longalg.op spolys0.op syz.op syz0.op syz1.op weight.op \ ipid.op ipshell.op iplib.op ipassign.op ipconv.op ipprint.op\ polys.op polys0.op polys1.op polys-impl.op extra.op\ mminit.op sing_dld.op sing_dbm.op silink.op \ sing_mp.op fglm.op fglmzero.op fglmvec.op fglmgauss.op fglmhom.op\ algmap.op clapconv.op clapmem.op clapsing.op \ cntrlc.op \ mpsr_Error.op mpsr_Put.op mpsr_PutPoly.op mpsr_GetPoly.op \ mpsr_Get.op mpsr_GetMisc.op \ ndbm.op spSpolyLoop.op libparse.op OBJP2= mmalloc.op mmallocb.op mmallocs.op mmblock.op \ mmspec.op mmutil.op weight0.op find_exec.op getopt.op OBJP=$(OBJP1) $(OBJP2) claptmpl.op ## ## .ob files for bprof ## OBJB1= grammar.ob scanner.ob matpol.ob binom.ob\ febase.ob feread.ob timer.ob intvec.ob attrib.ob lists.ob\ longrat.ob longrat0.ob misc.ob ring.ob numbers.ob maps.ob\ hilb.ob comm.ob kstd1.ob kstd2.ob kutil.ob khstd.ob kstdfac.ob modulop.ob \ spolys.ob ideals.ob subexpr.ob hdegree.ob hutil.ob ffields.ob shortfl.ob \ longalg.ob spolys0.ob syz.ob syz0.ob syz1.ob weight.ob \ ipid.ob ipshell.ob iplib.ob ipassign.ob ipconv.ob ipprint.ob\ polys.ob polys0.ob polys1.ob polys-impl.ob extra.ob\ mminit.ob sing_dld.ob sing_dbm.ob silink.ob \ sing_mp.ob fglm.ob fglmzero.ob fglmvec.ob fglmgauss.ob fglmhom.ob\ algmap.ob clapconv.ob clapmem.ob clapsing.ob \ cntrlc.ob \ mpsr_Error.ob mpsr_Put.ob mpsr_PutPoly.ob mpsr_GetPoly.ob \ mpsr_Get.ob mpsr_GetMisc.ob \ ndbm.ob spSpolyLoop.ob libparse.ob OBJB2= mmalloc.ob mmallocb.ob mmallocs.ob mmblock.ob \ mmspec.ob mmutil.ob weight0.ob find_exec.ob getopt.ob OBJB=$(OBJB1) $(OBJB2) claptmpl.ob ## ## profile targets ## ## for gprof claptmpl.op: claptmpl.cc mod2.h $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@ $(OBJP1): %.op: %.cc $(CXXP) ${CXXFLAGSP} ${CXXTEMPLFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@ $(OBJP2): %.op: %.c $(CCP) ${CFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@ Singularp: scanner.cc $(OBJP) iparith.op mpsr_Tok.op tesths.cc version.h $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -o Singularp \ tesths.cc iparith.op mpsr_Tok.op $(OBJP) ${LDFLAGSP} ${LIBS} iparith.op: iparith.inc iparith.cc $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -c iparith.cc -o iparith.op mpsr_Tok.op: iparith.inc mpsr_Tok.cc $(CXXP) ${CXXFLAGSP} ${CPPFLAGS} ${DEFSP} -c mpsr_Tok.cc -o mpsr_Tok.op ## for pbrof claptmpl.ob: claptmpl.cc mod2.h $(CXXP) ${CXXFLAGSB} ${CPPFLAGS} ${DEFSB} -c $< -o $@ $(OBJB1): %.ob: %.cc $(CXXP) ${CXXFLAGSB} ${CXXTEMPLFLAGSB} ${CPPFLAGS} ${DEFSB} -c $< -o $@ $(OBJB2): %.ob: %.c $(CCP) ${CFLAGSB} ${CPPFLAGS} ${DEFSB} -c $< -o $@ Singularb: scanner.cc $(OBJB) iparith.ob mpsr_Tok.ob tesths.cc version.h $(CXXP) ${CXXFLAGSB} ${CPPFLAGS} ${DEFSB} -o Singularb \ tesths.cc iparith.ob mpsr_Tok.ob $(OBJB) $(BPROFOBJ) \ ${LDFLAGSB} ${LIBS} iparith.ob: iparith.inc iparith.cc $(CXXP) ${CXXFLAGSB} ${CPPFLAGS} ${DEFSB} -c iparith.cc -o iparith.ob mpsr_Tok.ob: iparith.inc mpsr_Tok.cc $(CXXP) ${CXXFLAGSB} ${CPPFLAGS} ${DEFSB} -c mpsr_Tok.cc -o mpsr_Tok.ob installp: Singularp ${MKINSTALLDIRS} ${bindir} ${INSTALL_PROGRAM} Singularp ${bindir} ## ## dependencies ## %.dd: %.cc mod2.h echo $(@:.dd=.og) $(@:.dd=.op) $(@:.dd=.ob) " " \\ > $@ $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@ %.d: %.c mod2.h echo $(@:.d=.og) $(@:.d=.op) $(@:.d=.ob) " " \\ > $@ $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@ depend: $(CXXSOURCES:.cc=.dd) $(CSOURCES:.c=.d) mod2.h cat *.d *.dd >depend #include $(SOURCES:.cc=.dd) $(CSOURCES:.c=.d) #include *.d *.dd ifeq (depend,$(wildcard depend)) include depend endif