2017-04-25 14:41:48 +02:00
|
|
|
#
|
|
|
|
|
# rcsid "$Header: /usr/cvsroot/magic-8.0/ext2sim/Makefile,v 1.1.1.1 2008/02/03 20:43:50 tim Exp $"
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
MODULE = ext2sim
|
|
|
|
|
MAGICDIR = ..
|
|
|
|
|
SRCS = ext2sim.c
|
|
|
|
|
|
|
|
|
|
EXTRA_LIBS = ${MAGICDIR}/extflat/libextflat.o ${MAGICDIR}/utils/libutils.a
|
|
|
|
|
|
|
|
|
|
include ${MAGICDIR}/defs.mak
|
|
|
|
|
|
|
|
|
|
LIBS += -lm ${LD_EXTRA_LIBS} ${SUB_EXTRA_LIBS}
|
2025-07-18 14:21:40 +02:00
|
|
|
CLEANS += exttosim${SHDLIB_EXT} simwrap.o finds.o ext2sim_main.o ext2sim_main finds sim2simp
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2025-07-18 14:21:40 +02:00
|
|
|
main: finds sim2simp # ext2sim_main # deprecated
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
tcl-main: exttosim${SHDLIB_EXT}
|
|
|
|
|
|
2025-07-18 14:21:40 +02:00
|
|
|
# Not linkable due to libutils.a needing more hierarchical separation
|
|
|
|
|
ext2sim_main: ext2sim_main.o ${EXTRA_LIBS} ${MAGICDIR}/tiles/libtiles.o
|
2026-07-20 13:03:14 +02:00
|
|
|
${CC} ${LDFLAGS} ${CFLAGS} -o $@ $^ ${LD_FIRST_LIBS} ${LIBS} -lX11 -lz
|
2025-07-18 14:21:40 +02:00
|
|
|
|
|
|
|
|
ext2sim_main.o: ext2sim.c
|
build: out-of-tree .so variants, oa, and latexfiles PS regen
Extend the out-of-tree build to the outliers deferred earlier, and
audit install sourcing. All are read-source / write-build now.
Tcl auto-load shared libraries (built via each module's `tcl-main`;
not part of the default TCL build, but now correct when invoked):
* lef/plot/router/ext2spice/ext2sim: the hand-written object rules
(tcllef.o, tclplot.o, tclroute.o, spicewrap.o, spicehier.o, simwrap.o,
ext2sim_main.o) compiled a bare-name source from the cwd; switch to
`-c $< -o $@` so the source is found via VPATH and the object lands in
the build tree. ext2sim_main.o also swaps the hard-coded -I${MAGICDIR}
for ${CPPFLAGS} (build + source include paths). ext2spice spice2sim
install copies $< (source script). Sibling ${MAGICDIR}/<mod>/lib*.o
refs already resolve into the build tree (MAGICDIR = build top).
oa (disabled by default; OpenAccess):
* CXX_INCLUDES -I. -> -I$(srcdir) -I${MAGICDIR} -I${MAGICSRC} so the C++
sources, generated database/database.h, and cross-module headers all
resolve out-of-tree; .deps and objects were already build-local.
doc/latexfiles PostScript regeneration:
* Split PS_SRCDIR (pre-built PS shipped in the source tree, read-only)
from PS_GENDIR (= psfiles in the build tree). `all` / the .tex.ps
rule now regenerate into PS_GENDIR (mkdir -p; latex reads $(srcdir)
via TEXINPUTS; dvips writes the build tree) instead of writing back
into the source psfiles dir. install takes each .ps from PS_GENDIR if
regenerated there, else the pre-built PS_SRCDIR copy.
Verified out-of-tree (make modules; then per-module tcl-main):
* magiclef.so / tclplot.so / tclroute.so / exttospice.so / exttosim.so
all build into the build tree (rc=0); oa.o builds into the build tree;
source tree stays clean.
* install-tcl copies each .so from the build tree.
* Install-location audit on a full `make install DESTDIR=...`: generated
data (scmos.tech, .magicrc, magic.tcl, tclmagic.so) matches the build
tree; verbatim data (glyphs, fonts, magicps.pro, man pages, doc PS)
matches the source tree.
* DESTDIR: two distinct prefixes install 376 files each, independent and
fully contained (nothing written outside DESTDIR).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 15:39:35 +02:00
|
|
|
${CC} ${CFLAGS} ${CPPFLAGS} -DEXT2SIM_MAIN -c -o $@ $<
|
2025-07-18 14:21:40 +02:00
|
|
|
|
|
|
|
|
finds: finds.o ${MAGICDIR}/utils/libutils.a
|
|
|
|
|
${CC} ${LDFLAGS} ${CFLAGS} -o $@ $^
|
|
|
|
|
|
2017-04-25 14:41:48 +02:00
|
|
|
simwrap.o: ext2sim.c
|
build: out-of-tree .so variants, oa, and latexfiles PS regen
Extend the out-of-tree build to the outliers deferred earlier, and
audit install sourcing. All are read-source / write-build now.
Tcl auto-load shared libraries (built via each module's `tcl-main`;
not part of the default TCL build, but now correct when invoked):
* lef/plot/router/ext2spice/ext2sim: the hand-written object rules
(tcllef.o, tclplot.o, tclroute.o, spicewrap.o, spicehier.o, simwrap.o,
ext2sim_main.o) compiled a bare-name source from the cwd; switch to
`-c $< -o $@` so the source is found via VPATH and the object lands in
the build tree. ext2sim_main.o also swaps the hard-coded -I${MAGICDIR}
for ${CPPFLAGS} (build + source include paths). ext2spice spice2sim
install copies $< (source script). Sibling ${MAGICDIR}/<mod>/lib*.o
refs already resolve into the build tree (MAGICDIR = build top).
oa (disabled by default; OpenAccess):
* CXX_INCLUDES -I. -> -I$(srcdir) -I${MAGICDIR} -I${MAGICSRC} so the C++
sources, generated database/database.h, and cross-module headers all
resolve out-of-tree; .deps and objects were already build-local.
doc/latexfiles PostScript regeneration:
* Split PS_SRCDIR (pre-built PS shipped in the source tree, read-only)
from PS_GENDIR (= psfiles in the build tree). `all` / the .tex.ps
rule now regenerate into PS_GENDIR (mkdir -p; latex reads $(srcdir)
via TEXINPUTS; dvips writes the build tree) instead of writing back
into the source psfiles dir. install takes each .ps from PS_GENDIR if
regenerated there, else the pre-built PS_SRCDIR copy.
Verified out-of-tree (make modules; then per-module tcl-main):
* magiclef.so / tclplot.so / tclroute.so / exttospice.so / exttosim.so
all build into the build tree (rc=0); oa.o builds into the build tree;
source tree stays clean.
* install-tcl copies each .so from the build tree.
* Install-location audit on a full `make install DESTDIR=...`: generated
data (scmos.tech, .magicrc, magic.tcl, tclmagic.so) matches the build
tree; verbatim data (glyphs, fonts, magicps.pro, man pages, doc PS)
matches the source tree.
* DESTDIR: two distinct prefixes install 376 files each, independent and
fully contained (nothing written outside DESTDIR).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 15:39:35 +02:00
|
|
|
${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} -c $< -o $@
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
exttosim${SHDLIB_EXT}: simwrap.o ${MAGICDIR}/extflat/libextflat.o
|
|
|
|
|
@echo --- making exttosim Tcl library \(exttosim${SHDLIB_EXT}\)
|
|
|
|
|
${RM} exttosim${SHDLIB_EXT}
|
2026-07-20 16:21:56 +02:00
|
|
|
${CC} ${CFLAGS} ${CPPFLAGS} -o $@ ${LDFLAGS} ${LDDL_FLAGS} simwrap.o \
|
2026-07-20 13:03:14 +02:00
|
|
|
${MAGICDIR}/extflat/libextflat.o ${LD_SHARED} ${LD_FIRST_LIBS} -lc ${LIBS}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2020-01-28 16:40:01 +01:00
|
|
|
install: $(DESTDIR)${INSTALL_BINDIR}/${MODULE}${EXEEXT}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2020-01-28 16:40:01 +01:00
|
|
|
install-tcl: $(DESTDIR)${INSTALL_TCLDIR}/exttosim${SHDLIB_EXT}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2020-01-28 16:40:01 +01:00
|
|
|
$(DESTDIR)${INSTALL_TCLDIR}/exttosim${SHDLIB_EXT}: exttosim${SHDLIB_EXT}
|
|
|
|
|
${RM} $(DESTDIR)${INSTALL_TCLDIR}/exttosim${SHDLIB_EXT}
|
|
|
|
|
${CP} exttosim${SHDLIB_EXT} $(DESTDIR)${INSTALL_TCLDIR}/exttosim${SHDLIB_EXT}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
include ${MAGICDIR}/rules.mak
|