2017-04-25 14:41:48 +02:00
|
|
|
#
|
|
|
|
|
# OpenAccess module Makefile
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
MODULE = oa
|
2026-07-22 19:30:32 +02:00
|
|
|
# Provided by configure: the module's source dir + the build top.
|
|
|
|
|
# defs.mak sees `srcdir` already set and skips its own srcdir derivation.
|
|
|
|
|
srcdir = @srcdir@
|
|
|
|
|
VPATH = @srcdir@
|
|
|
|
|
MAGICDIR = @top_builddir@
|
2017-04-25 14:41:48 +02:00
|
|
|
SRCS = oa.c
|
|
|
|
|
CXXSRCS = magicInit.cpp magicOA.cpp
|
|
|
|
|
|
|
|
|
|
include ${MAGICDIR}/defs.mak
|
|
|
|
|
|
|
|
|
|
#----------------------------------------
|
|
|
|
|
|
2024-10-04 22:14:01 +02:00
|
|
|
ifeq ($(OA),)
|
|
|
|
|
OA := fake_oa_stub
|
|
|
|
|
endif
|
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
|
|
|
# -I$(srcdir): this module's C++ sources/headers (source tree)
|
|
|
|
|
# -I${MAGICDIR}: build top, for the generated database/database.h
|
|
|
|
|
# -I${MAGICSRC}: source top, for "<module>/<header>.h" includes
|
|
|
|
|
CXX_INCLUDES = -I$(srcdir) -I${MAGICDIR} -I${MAGICSRC} -I${OA}/oa/include
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2024-10-04 22:14:01 +02:00
|
|
|
DEPS_MAGIC := $(shell mkdir -p .deps > /dev/null 2>&1 || :)
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
DEP_FILES = $(addprefix .deps/,$(SRCS:.c=.P))\
|
|
|
|
|
$(addprefix .deps/,$(CXXSRCS:.cpp=.P))
|
|
|
|
|
|
|
|
|
|
-include ${DEP_FILES}
|
|
|
|
|
|
|
|
|
|
%.o: %.cpp
|
2024-10-04 22:14:01 +02:00
|
|
|
@echo '$(CXX) -c $<'; \
|
2017-04-25 14:41:48 +02:00
|
|
|
${CXX} ${CXX_CFLAGS} ${OTHER_CFLAGS} ${CXX_INCLUDES} -Wp,-MD,.deps/$(*F).pp -c $<
|
|
|
|
|
@-cp .deps/$(*F).pp .deps/$(*F).P; \
|
|
|
|
|
tr ' ' '\012' < .deps/$(*F).pp \
|
2025-01-08 10:02:35 +01:00
|
|
|
| ${SED} -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
2017-04-25 14:41:48 +02:00
|
|
|
>> .deps/$(*F).P; \
|
2024-10-16 11:28:42 +02:00
|
|
|
${RM} .deps/$(*F).pp
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2024-10-04 22:14:01 +02:00
|
|
|
oa-main: lib
|
|
|
|
|
|
|
|
|
|
module-clean:
|
|
|
|
|
${RM} ${CLEANS}
|
2017-04-25 14:41:48 +02:00
|
|
|
${RM} *.o
|
2024-10-04 22:14:01 +02:00
|
|
|
${RM} *.a
|
2017-04-25 14:41:48 +02:00
|
|
|
${RM} -r .deps
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------
|
2026-07-22 21:11:10 +02:00
|
|
|
include ${MAGICSRC}/rules.mak
|