From 4e967a476636faf3ffc2980763bb8a513cc5b205 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Wed, 22 Jul 2026 12:59:44 +0000 Subject: [PATCH] =?UTF-8?q?build:=20out-of-tree=20outlier=20Makefiles=20?= =?UTF-8?q?=E2=80=94=20full=20make=20+=20install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) --- doc/Makefile | 14 ++++++-------- doc/html/Makefile | 2 +- doc/latexfiles/Makefile | 4 +++- doc/man/Makefile | 4 ++-- doc/tutcells/Makefile | 2 +- graphics/Makefile | 6 +++--- magic/Makefile | 10 +++++----- scmos/Makefile | 36 ++++++++++++++++++++---------------- scmos/cif_template/Makefile | 22 +++++++++++----------- scripts/configure | 4 ++-- scripts/configure.in | 4 ++-- tcltk/Makefile | 21 +++++++++++---------- windows/Makefile | 4 ++-- 13 files changed, 69 insertions(+), 64 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index cebf18a7..d611b2de 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -15,17 +15,15 @@ GRN=grn -Ppsc TBL=tbl -Ppsc EQN=eqn -Ppsc +DOC_SUBDIRS = latexfiles man tutcells html + install-tcl: - cd latexfiles && ${MAKE} install - cd man && ${MAKE} install - cd tutcells && ${MAKE} install - cd html && ${MAKE} install + for dir in ${DOC_SUBDIRS}; do \ + mkdir -p $$dir && ${MAKE} -C $$dir -f ${MAGICSRC}/doc/$$dir/Makefile install; done install: - cd latexfiles && ${MAKE} install - cd man && ${MAKE} install - cd tutcells && ${MAKE} install - cd html && ${MAKE} install + for dir in ${DOC_SUBDIRS}; do \ + mkdir -p $$dir && ${MAKE} -C $$dir -f ${MAGICSRC}/doc/$$dir/Makefile install; done print_only: force lpr -h ${PSDIR}/copyright.ps diff --git a/doc/html/Makefile b/doc/html/Makefile index bf577bcc..62c5fd59 100644 --- a/doc/html/Makefile +++ b/doc/html/Makefile @@ -5,7 +5,7 @@ include $(MAGICDIR)/defs.mak HTML_INSTDIR=$(INSTALL_LIBDIR)/magic/doc/html install: $(DESTDIR)${HTML_INSTDIR} - tar cf - . | (cd $(DESTDIR)${HTML_INSTDIR}; tar xf - ) + tar -C $(srcdir) -cf - . | (cd $(DESTDIR)${HTML_INSTDIR}; tar xf - ) $(DESTDIR)${HTML_INSTDIR}: ${SCRIPTS}/mkdirs $(DESTDIR)${HTML_INSTDIR} diff --git a/doc/latexfiles/Makefile b/doc/latexfiles/Makefile index aeba340d..82dc2b35 100644 --- a/doc/latexfiles/Makefile +++ b/doc/latexfiles/Makefile @@ -2,7 +2,9 @@ MAGICDIR = ../.. include $(MAGICDIR)/defs.mak -PS_SRCDIR=../psfiles +# Pre-built PostScript ships in the source tree; regenerating it (the .tex.ps +# rule / `all` target) still writes back into the source psfiles dir. +PS_SRCDIR=${MAGICSRC}/doc/psfiles PS_INSTDIR=$(INSTALL_LIBDIR)/magic/doc .SUFFIXES: .dvi .tex .ps diff --git a/doc/man/Makefile b/doc/man/Makefile index da493492..45fc8966 100644 --- a/doc/man/Makefile +++ b/doc/man/Makefile @@ -38,13 +38,13 @@ $(DESTDIR)${INSTALL_MANDIR}/man1: $(DESTDIR)${INSTALL_MANDIR} ${SCRIPTS}/mkdirs $(DESTDIR)${INSTALL_MANDIR}/man1 $(DESTDIR)${INSTALL_MANDIR}/man1/%: % $(DESTDIR)${INSTALL_MANDIR}/man1 - ${CP} $* $(DESTDIR)${INSTALL_MANDIR}/man1/$* + ${CP} $< $(DESTDIR)${INSTALL_MANDIR}/man1/$* $(DESTDIR)${INSTALL_MANDIR}/man5: $(DESTDIR)${INSTALL_MANDIR} ${SCRIPTS}/mkdirs $(DESTDIR)${INSTALL_MANDIR}/man5 $(DESTDIR)${INSTALL_MANDIR}/man5/%: % $(DESTDIR)${INSTALL_MANDIR}/man5 - ${CP} $* $(DESTDIR)${INSTALL_MANDIR}/man5/$* + ${CP} $< $(DESTDIR)${INSTALL_MANDIR}/man5/$* mans: ${SCRIPTS}/printmans "${TROFF} ${MANMACS} -" *.1 *.5 diff --git a/doc/tutcells/Makefile b/doc/tutcells/Makefile index 1dc05d68..2831201d 100644 --- a/doc/tutcells/Makefile +++ b/doc/tutcells/Makefile @@ -34,4 +34,4 @@ make-tut-dirs: ${SCRIPTS}/mkdirs $(DESTDIR)${TUTDIR} $(DESTDIR)${TUTDIR}/%: % $(DESTDIR)${TUTDIR} - ${CP} $* $(DESTDIR)${TUTDIR}/$* + ${CP} $< $(DESTDIR)${TUTDIR}/$* diff --git a/graphics/Makefile b/graphics/Makefile index 3312adc5..3a1f9b36 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -57,7 +57,7 @@ main: ${GR_HELPER_PROG} ${GR_HELPER_PROG}: ${GR_HELPER_SRCS} @echo --- building main ${GR_HELPER_PROG} ${RM} ${GR_HELPER_PROG} - ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ${GR_HELPER_SRCS} \ + ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} $(addprefix $(srcdir)/,${GR_HELPER_SRCS}) \ -o ${GR_HELPER_PROG} ${LIBS} install: $(DESTDIR)${INSTALL_BINDIR}/${GR_HELPER_PROG} glyphs fonts @@ -71,11 +71,11 @@ $(DESTDIR)${INSTALL_BINDIR}/${GR_HELPER_PROG}: ${GR_HELPER_PROG} glyphs: ${GLYPHS} for i in ${GLYPHS}; do \ ${RM} $(DESTDIR)${INSTALL_SYSDIR}/$$i; \ - ${CP} $$i $(DESTDIR)${INSTALL_SYSDIR}; done + ${CP} $(srcdir)/$$i $(DESTDIR)${INSTALL_SYSDIR}; done fonts: ${OUTLINE_FONTS} for i in ${OUTLINE_FONTS}; do \ ${RM} $(DESTDIR)${INSTALL_SYSDIR}/$$i; \ - ${CP} $$i $(DESTDIR)${INSTALL_SYSDIR}; done + ${CP} $(srcdir)/$$i $(DESTDIR)${INSTALL_SYSDIR}; done include ${MAGICDIR}/rules.mak diff --git a/magic/Makefile b/magic/Makefile index a7dc9a7f..a8f7389d 100644 --- a/magic/Makefile +++ b/magic/Makefile @@ -50,7 +50,7 @@ ifeq (${MAKE_WASM},1) magicWasm.o: magicWasm.c @echo --- compiling magic/magicWasm.o '(no Tcl stubs)' ${RM} magicWasm.o - ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS_NOSTUB} -c magicWasm.c + ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS_NOSTUB} -c $< -o $@ magic.js: lib${MODULE}.o ${EXTRA_LIBS} @echo --- building main magic WASM @@ -81,7 +81,7 @@ tclmagic${SHDLIB_EXT}: ${EXTRA_LIBS} -lc ${LIBS} ${LIB_SPECS} proto.magicrc: proto.magicrc.in - ${MCPP} ${GR_DFLAGS} ${DFLAGS} proto.magicrc.in > proto.magicrc + ${MCPP} ${GR_DFLAGS} ${DFLAGS} $< > proto.magicrc install: $(DESTDIR)${INSTALL_BINDIR}/${MODULE}${EXEEXT} $(DESTDIR)${INSTALL_SYSDIR}/.magicrc \ $(DESTDIR)${INSTALL_SYSDIR}/magicps.pro @@ -95,7 +95,7 @@ $(DESTDIR)${INSTALL_TCLDIR}/tclmagic${SHDLIB_EXT}: tclmagic${SHDLIB_EXT} $(DESTDIR)${INSTALL_TCLDIR}/bitmaps/%: bitmaps/% ${RM} $(DESTDIR)${INSTALL_TCLDIR}/bitmaps/$* - ${CP} bitmaps/$* $(DESTDIR)${INSTALL_TCLDIR}/bitmaps/$* + ${CP} $< $(DESTDIR)${INSTALL_TCLDIR}/bitmaps/$* $(DESTDIR)${INSTALL_SYSDIR}/.magicrc: proto.magicrc ${RM} $(DESTDIR)${INSTALL_SYSDIR}/.magicrc @@ -103,11 +103,11 @@ $(DESTDIR)${INSTALL_SYSDIR}/.magicrc: proto.magicrc $(DESTDIR)${INSTALL_SYSDIR}/.initrc: proto.initrc ${RM} $(DESTDIR)${INSTALL_SYSDIR}/.initrc - ${CP} proto.initrc $(DESTDIR)${INSTALL_SYSDIR}/.initrc + ${CP} $< $(DESTDIR)${INSTALL_SYSDIR}/.initrc $(DESTDIR)${INSTALL_SYSDIR}/magicps.pro: magicps.pro ${RM} $(DESTDIR)${INSTALL_SYSDIR}/magicps.pro - ${CP} magicps.pro $(DESTDIR)${INSTALL_SYSDIR}/magicps.pro + ${CP} $< $(DESTDIR)${INSTALL_SYSDIR}/magicps.pro include ${MAGICDIR}/rules.mak diff --git a/scmos/Makefile b/scmos/Makefile index 9516cb61..e225d1c3 100644 --- a/scmos/Makefile +++ b/scmos/Makefile @@ -17,7 +17,7 @@ MAGICDIR = .. include ${MAGICDIR}/defs.mak -SC_PP = ${MCPP} -I./extract_template +SC_PP = ${MCPP} -I$(srcdir)/extract_template FILES = mos.7bit.dstyle mos.7bit.std.cmap \ mos.24bit.dstyle mos.24bit.std.cmap \ @@ -52,43 +52,45 @@ all: $(OBJS) $(DEPEND) ${TECHFILES} install-tcl: all for i in ${FILES} ${TECHFILES}; do \ - ${CP} $$i $(DESTDIR)${INSTALL_SYSDIR}; done + f=$$i; test -f $$f || f=$(srcdir)/$$i; \ + ${CP} $$f $(DESTDIR)${INSTALL_SYSDIR}; done install: all for i in ${FILES} ${TECHFILES}; do \ - ${CP} $$i $(DESTDIR)${INSTALL_SYSDIR}; done + f=$$i; test -f $$f || f=$(srcdir)/$$i; \ + ${CP} $$f $(DESTDIR)${INSTALL_SYSDIR}; done scmos.tech: $(OBJS) - $(MSED) scmos.tech.in > scmos.tech.out + $(MSED) $(srcdir)/scmos.tech.in > scmos.tech.out $(SC_PP) -DV5 -DSTANDARD scmos.tech.out > scmos.tech $(RM) scmos.tech.out scmos-tm.tech: $(OBJS) - $(MSED) scmos.tech.in > scmos.tech.out - cat scmos.tech.in > scmos.tech.out + $(MSED) $(srcdir)/scmos.tech.in > scmos.tech.out + cat $(srcdir)/scmos.tech.in > scmos.tech.out $(SC_PP) -DV5 -DHPTECH -DTIGHTMETAL scmos.tech.out > scmos-tm.tech $(RM) scmos.tech.out scmos-sub.tech: $(OBJS) - $(MSED) scmos.tech.in > scmos.tech.out - cat scmos.tech.in > scmos.tech.out + $(MSED) $(srcdir)/scmos.tech.in > scmos.tech.out + cat $(srcdir)/scmos.tech.in > scmos.tech.out $(SC_PP) -DV5 -DSUBMICRON scmos.tech.out > scmos-sub.tech $(RM) scmos.tech.out scmosWR.tech: $(OBJS) - $(MSED) scmos.tech.in > scmos.tech.out - cat scmos.tech.in > scmos.tech.out + $(MSED) $(srcdir)/scmos.tech.in > scmos.tech.out + cat $(srcdir)/scmos.tech.in > scmos.tech.out $(SC_PP) -DV5 -DSTANDARD -DWELL_ROUTE_CHECK scmos.tech.out > scmosWR.tech $(RM) scmos.tech.out minimum.tech: minimum.tech.in - $(SC_PP) minimum.tech.in > minimum.tech + $(SC_PP) $< > minimum.tech gdsquery.tech: gdsquery.tech.in - $(SC_PP) gdsquery.tech.in > gdsquery.tech + $(SC_PP) $< > gdsquery.tech nmos.tech: nmos.tech.in - $(CP) nmos.tech.in nmos.tech + $(CP) $< nmos.tech $(CIFin): $(CIFout): @@ -98,11 +100,13 @@ $(HCIFin): $(HCIFout): $(SCIFin): $(SCIFout): - cd cif_template && ${MAKE} clean && ${MAKE} + mkdir -p cif_template + ${MAKE} -C cif_template -f ${MAGICSRC}/scmos/cif_template/Makefile clean + ${MAKE} -C cif_template -f ${MAGICSRC}/scmos/cif_template/Makefile $(DESTDIR)${INSTALL_SYSDIR}/%: % - cp $* $(DESTDIR)${INSTALL_SYSDIR}/$* + cp $< $(DESTDIR)${INSTALL_SYSDIR}/$* clean:; -$(RM) *.tech *.tech27 - cd cif_template && ${MAKE} clean + test -d cif_template && ${MAKE} -C cif_template -f ${MAGICSRC}/scmos/cif_template/Makefile clean || true diff --git a/scmos/cif_template/Makefile b/scmos/cif_template/Makefile index 13069a55..d2b0b13b 100644 --- a/scmos/cif_template/Makefile +++ b/scmos/cif_template/Makefile @@ -1,6 +1,6 @@ MAGICDIR = ../.. -MKDIR = $(MAGICDIR)/scripts/mkdirs +MKDIR = $(MAGICSRC)/scripts/mkdirs OBJS_DIR = objs CIFIN = $(OBJS_DIR)/CIFin CIFOUT = $(OBJS_DIR)/CIFout @@ -15,7 +15,7 @@ SED_CMD = sed -e "s/\\\\/\\\\\\\\/" -e "/^\#/D" -e "s/(gen )/(gen)/" -e "s/(n include ${MAGICDIR}/defs.mak -SC_CPP = ${CPP} +SC_CPP = ${CPP} -I$(srcdir) all: $(OBJS_DIR) $(CIFIN) $(CIFOUT) $(IBMCIFIN) $(IBMCIFOUT) $(TMCIFIN) \ $(TMCIFOUT) $(SUBCIFIN) $(SUBCIFOUT) @@ -26,7 +26,7 @@ clean:; scg: cifout.c cifout-cmos26b.gen cifout.gen cifout.nw\ cifout.others cifout.pw cifout.scgnw cifout.scgpw rm -f $(CIFOUT) - $(SC_CPP) scgcifout.c | ${SED_CMD} > $(CIFOUT) + $(SC_CPP) $(srcdir)/scgcifout.c | ${SED_CMD} > $(CIFOUT) $(OBJS_DIR): $(MKDIR) $(OBJS_DIR) @@ -34,33 +34,33 @@ $(OBJS_DIR): $(CIFIN): $(OBJS_DIR) cifin.c cifin-cmos26b.gen cifin.gen cifin.nw cifin.oldnw\ cifin.others cifin.pw cifin-ami16.gen rm -f $(CIFIN) - $(SC_CPP) -DSTANDARD cifin.c | ${SED_CMD} > $(CIFIN) + $(SC_CPP) -DSTANDARD $(srcdir)/cifin.c | ${SED_CMD} > $(CIFIN) $(CIFOUT): $(OBJS_DIR) cifout.c cifout-cmos26b.gen cifout.gen cifout.nw\ cifout.others cifout.pw cifout-ami16.gen rm -f $(CIFOUT) - $(SC_CPP) -DSTANDARD cifout.c | ${SED_CMD} > $(CIFOUT) + $(SC_CPP) -DSTANDARD $(srcdir)/cifout.c | ${SED_CMD} > $(CIFOUT) $(IBMCIFIN): $(OBJS_DIR) cifin.c cifin-ibm.gen rm -f $(IBMCIFIN) - $(SC_CPP) -DIBM cifin.c | ${SED_CMD} > $(IBMCIFIN) + $(SC_CPP) -DIBM $(srcdir)/cifin.c | ${SED_CMD} > $(IBMCIFIN) $(IBMCIFOUT): $(OBJS_DIR) cifout.c cifout-ibm.gen rm -f $(IBMCIFOUT) - $(SC_CPP) -DIBM cifout.c | ${SED_CMD} > $(IBMCIFOUT) + $(SC_CPP) -DIBM $(srcdir)/cifout.c | ${SED_CMD} > $(IBMCIFOUT) $(TMCIFIN): $(OBJS_DIR) cifin.c cifin-cmos26b.gen rm -f $(TMCIFIN) - $(SC_CPP) -DTIGHTMETAL cifin.c | ${SED_CMD} > $(TMCIFIN) + $(SC_CPP) -DTIGHTMETAL $(srcdir)/cifin.c | ${SED_CMD} > $(TMCIFIN) $(TMCIFOUT): $(OBJS_DIR) cifout.c cifout-cmos26b.gen rm -f $(TMCIFOUT) - $(SC_CPP) -DTIGHTMETAL cifout.c | ${SED_CMD} > $(TMCIFOUT) + $(SC_CPP) -DTIGHTMETAL $(srcdir)/cifout.c | ${SED_CMD} > $(TMCIFOUT) $(SUBCIFIN): $(OBJS_DIR) cifin.c cifin-cmos26g.gen cifin-cmos14b.gen rm -f $(SUBCIFIN) - $(SC_CPP) -DSUBMICRON cifin.c | ${SED_CMD} > $(SUBCIFIN) + $(SC_CPP) -DSUBMICRON $(srcdir)/cifin.c | ${SED_CMD} > $(SUBCIFIN) $(SUBCIFOUT): $(OBJS_DIR) cifout.c cifout-cmos26g.gen cifout-cmos14b.gen rm -f $(SUBCIFOUT) - $(SC_CPP) -DSUBMICRON cifout.c | ${SED_CMD} > $(SUBCIFOUT) + $(SC_CPP) -DSUBMICRON $(srcdir)/cifout.c | ${SED_CMD} > $(SUBCIFOUT) diff --git a/scripts/configure b/scripts/configure index 942c1124..1f9b5368 100755 --- a/scripts/configure +++ b/scripts/configure @@ -6368,7 +6368,7 @@ if test "x${PYTHON3}" == "xno"; then fi else - MCPP="${PYTHON3} \${MAGICDIR}/scripts/preproc.py -ccomm" + MCPP="${PYTHON3} \${MAGICSRC}/scripts/preproc.py -ccomm" MSED="cat" usingPython3=1 fi @@ -9204,7 +9204,7 @@ fi esac fi if test "$with_gnu_ld" = "yes" ; then - LDDL_FLAGS="${LDDL_FLAGS} -Wl,--version-script=\${MAGICDIR}/magic/symbol.map" + LDDL_FLAGS="${LDDL_FLAGS} -Wl,--version-script=\${MAGICSRC}/magic/symbol.map" fi diff --git a/scripts/configure.in b/scripts/configure.in index f6cc9e51..8fc89cb5 100644 --- a/scripts/configure.in +++ b/scripts/configure.in @@ -380,7 +380,7 @@ if test "x${PYTHON3}" == "xno"; then fi else - MCPP="${PYTHON3} \${MAGICDIR}/scripts/preproc.py -ccomm" + MCPP="${PYTHON3} \${MAGICSRC}/scripts/preproc.py -ccomm" MSED="cat" usingPython3=1 fi @@ -1889,7 +1889,7 @@ if test $usingTcl ; then esac fi if test "$with_gnu_ld" = "yes" ; then - LDDL_FLAGS="${LDDL_FLAGS} -Wl,--version-script=\${MAGICDIR}/magic/symbol.map" + LDDL_FLAGS="${LDDL_FLAGS} -Wl,--version-script=\${MAGICSRC}/magic/symbol.map" fi AC_SUBST(SHDLIB_EXT) diff --git a/tcltk/Makefile b/tcltk/Makefile index 451e0866..c457c8f9 100644 --- a/tcltk/Makefile +++ b/tcltk/Makefile @@ -58,41 +58,42 @@ install-tcl: magicexec magicdnull ${BIN_FILES} ${TCL_FILES} ${CP} magicdnull $(DESTDIR)${INSTALL_TCLDIR}/magicdnull (cd $(DESTDIR)${INSTALL_TCLDIR}; ${RM} ${TCL_FILES}) for i in ${TCL_FILES}; do \ - ${CP} $$i $(DESTDIR)${INSTALL_TCLDIR}; done + f=$$i; test -f $$f || f=$(srcdir)/$$i; \ + ${CP} $$f $(DESTDIR)${INSTALL_TCLDIR}; done (cd $(DESTDIR)${INSTALL_TCLDIR}; chmod 0755 tkcon.tcl tkshell.tcl) magicexec: magicexec.c ${MAGICDIR}/defs.mak - ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS_NOSTUB} ${LDFLAGS} magicexec.c \ + ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS_NOSTUB} ${LDFLAGS} $< \ -o magicexec ${LD_RUN_PATH} ${LD_FIRST_LIBS} ${LIB_SPECS_NOSTUB} ${ZLIB_FLAG} \ ${LIBS} ${GR_LIBS} magicdnull: magicdnull.c ${MAGICDIR}/defs.mak - ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS_NOSTUB} ${LDFLAGS} magicdnull.c \ + ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS_NOSTUB} ${LDFLAGS} $< \ -o magicdnull ${LD_RUN_PATH} ${LD_FIRST_LIBS} ${LIB_SPECS_GRNULL} ${ZLIB_FLAG} \ ${LIBS} -magic.tcl: magic.tcl.in ${MAGICDIR}/defs.mak ${MAGICDIR}/VERSION +magic.tcl: magic.tcl.in ${MAGICDIR}/defs.mak ${MAGICSRC}/VERSION ${SED} -e /MAGIC_VERSION/s%MAGIC_VERSION%${MAGIC_VERSION}%g \ -e /MAGIC_REVISION/s%MAGIC_REVISION%${MAGIC_REVISION}%g \ -e /MAGIC_COMMIT/s%MAGIC_COMMIT%${MAGIC_COMMIT}%g \ - magic.tcl.in > magic.tcl + $< > magic.tcl magic.sh: magic.sh.in ${MAGICDIR}/defs.mak ${SED} -e /TCL_DIR/s%TCL_DIR%${TCLDIR}%g \ -e /TCLLIB_DIR/s%TCLLIB_DIR%${TCL_LIB_DIR}%g \ - -e /WISH_EXE/s%WISH_EXE%${WISH_EXE}%g magic.sh.in > magic.sh + -e /WISH_EXE/s%WISH_EXE%${WISH_EXE}%g $< > magic.sh ext2spice.sh: ext2spice.sh.in ${MAGICDIR}/defs.mak ${SED} -e /TCL_DIR/s%TCL_DIR%${TCLDIR}%g \ - ext2spice.sh.in > ext2spice.sh + $< > ext2spice.sh ext2sim.sh: ext2sim.sh.in ${MAGICDIR}/defs.mak ${SED} -e /TCL_DIR/s%TCL_DIR%${TCLDIR}%g \ - ext2sim.sh.in > ext2sim.sh + $< > ext2sim.sh $(DESTDIR)${INSTALL_TCLDIR}/%: % ${RM} $(DESTDIR)${INSTALL_TCLDIR}/$* - ${CP} $* $(DESTDIR)${INSTALL_TCLDIR}/$* + ${CP} $< $(DESTDIR)${INSTALL_TCLDIR}/$* $(DESTDIR)${INSTALL_BINDIR}/magic.sh: magic.sh ${RM} $(DESTDIR)${INSTALL_BINDIR}/magic.sh $(DESTDIR)${INSTALL_BINDIR}/magic @@ -110,6 +111,6 @@ $(DESTDIR)${INSTALL_BINDIR}/ext2sim.sh: ext2sim.sh (cd $(DESTDIR)${INSTALL_BINDIR}; chmod 0755 ext2sim) # An additional dependency on the VERSION file -${OBJS}: ${MAGICDIR}/VERSION +${OBJS}: ${MAGICSRC}/VERSION include ${MAGICDIR}/rules.mak diff --git a/windows/Makefile b/windows/Makefile index 9795a732..2210e552 100644 --- a/windows/Makefile +++ b/windows/Makefile @@ -18,10 +18,10 @@ install-tcl: @echo --- installing glyphs to $(DESTDIR)${INSTALL_SYSDIR} for i in ${GLYPHS} ${FONTS}; do \ (cd $(DESTDIR)${INSTALL_SYSDIR} && ${RM} $$i); \ - ${CP} $$i $(DESTDIR)${INSTALL_SYSDIR}; done + ${CP} $(srcdir)/$$i $(DESTDIR)${INSTALL_SYSDIR}; done install: @echo --- installing glyphs to $(DESTDIR)${INSTALL_SYSDIR} for i in ${GLYPHS} ${FONTS}; do \ (cd $(DESTDIR)${INSTALL_SYSDIR} && ${RM} $$i); \ - ${CP} $$i $(DESTDIR)${INSTALL_SYSDIR}; done + ${CP} $(srcdir)/$$i $(DESTDIR)${INSTALL_SYSDIR}; done