AIMK(1PVM)
β¨ aimk β the make wrapper that gets it π
okay bestie, so this page is from the PVM Version 3.4 manual, section 1PVM, and it's all about aimk. sit down, grab a boba, we're doing this π§π
πΈ NAME πΈ
aimk β Portable make wrapper script β¨
like, it's a wrapper. for make. but make it portable. no cap. π«Ά
π SYNOPSIS π
aimk [ -here ] [ make arguments ]
that's it. that's the whole vibe. π
π DESCRIPTION π
okay so aimk is a wrapper program for make, and the whole point is that it portably picks the right options to build PVM and PVM applications on basically every machine ever. every port of PVM gets its own little name β an architecture name β and that name is doing double duty:
- it's used during compilation, to conditionally switch in code
- and it's used at runtime, to select an executable or a host
iconic, honestly. π
so how does aimk figure out which architecture it's on? it looks at the environment variable $PVM_ARCH, and if that's set, boom, done, that's the answer. but if it's not set, it calls $PVM_ROOT/pvmgetarch instead. and pvmgetarch is a script that literally sniffs at various parts of the system to figure out the correct architecture name β yes, sniffing, that's the actual word, we love a detective ππ¦. it gets updated whenever new PVM ports are defined, and you can totally augment it locally. iykyk. π
then aimk determines the machine architecture and execs make, handing it the architecture and a configuration file, plus whatever arguments you gave to aimk. and here's the cute part β it runs make in a subdirectory, which does two things:
- stops executables from becoming all intermixed π«§
- lets you do overlapping compiles β‘
you can drop a different makefile in each subdirectory, or share a single makefile called Makefile.aimk between architectures. per-architecture definitions from the $PVM_ROOT/conf directory get appended to the common makefile. chef's kiss. π§βπ³π
now β aimk calls make in one of three ways, depending on which makefiles are actually present:
- i. if
$PVM_ARCH/Makefileor$PVM_ARCH/makefileexists, it changes directory to$PVM_ARCHand execsmakeright there:
(cd $PVM_ARCH ; make PVM_ARCH=$PVM_ARCH < aimk args >)
- ii. else if
Makefile.aimkexists, it creates the$PVM_ARCHdirectory if it doesn't already exist, and then:
(cd $PVM_ARCH ; \
make -f $PVM_ROOT/conf/$PVM_ARCH.def \
-f ../Makefile.aimk PVM_ARCH=$PVM_ARCH < aimk args >)
- iii. else it just execs
makein the current directory:
make PVM_ARCH=$PVM_ARCH < aimk args >
and the exit status? if aimk succeeds in calling make, the exit status is the exit status of make. otherwise it's 1. that's the whole deal. periodt. π
π¦ FLAGS π¦
-hereβ forcesaimkto runmakein the current directory. like, it literally converts case i. into case iii. that's the energy. π
β EXAMPLES β
okay so here's a Makefile.aimk that builds and installs hello, and creates the PVM binary directory if it doesn't exist yet. the cute part is it can run concurrently on machines of different types while sharing the same source directory. slay. π
LDIR = -L$(PVM_ROOT)/lib/$(PVM_ARCH)
PVMLIB = -lpvm3
SDIR = ..
BDIR = $(HOME)/pvm3/bin
XDIR = $(BDIR)/$(PVM_ARCH)
CFLAGS = -g -I$(PVM_ROOT)/include
LIBS = $(LDIR) $(PVMLIB) $(ARCHLIB)
$(XDIR):
- mkdir $(BDIR) $(XDIR)
hello: $(SDIR)/hello.c $(XDIR)
$(CC) $(CFLAGS) -o $@ $(SDIR)/$@.c $(LIBS)
mv $@ $(XDIR)
look at it. look at it go. π₯Ήβ¨
π ENVIRONMENT π
$PVM_ROOTβ root path of PVM installation.$PVM_ARCHβ PVM architecture name for machine.
π FILES π
$PVM_ROOT/lib/aimkβ theaimkprogram$PVM_ROOT/conf/$PVM_ARCH.defβ arch config file
π«Ά SEE ALSO π«Ά
pvm_intro(1PVM)
ok that's the whole page bestie, every single flag, every code block, every path, all three makefile cases, no crumbs left. π
and that's a wrap, angel β this was PVM Version 3.4, dated 02 May, 1994 πΈ (yes, the 90s, we stan an elder icon π ). go build something cute. mwah. ππβ¨
π¦ where this page comes from
- debian bookworm: pvm-dev 3.4.6-5
- ubuntu jammy: pvm-dev 3.4.6-3.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms