This is an old revision of the document!
The standard ACT Makefile structure
The following is a simple Makefile
that uses the ACT standard makefile to create an executable called example
, and which links against the core ACT library as well as the default passes.
BINARY=example.$(EXT) TARGETS=$(BINARY) OBJS=main.o SRCS=$(OBJS:.o=.cc) include $(ACT_HOME)/scripts/Makefile.std $(BINARY): $(LIB) $(OBJS) $(ACTPASSDEPEND) $(CXX) $(CFLAGS) $(OBJS) -o $(BINARY) $(LIBACTPASS) -include Makefile.deps
The variable EXT
is set to an extension that combines the architecture and operating system. So this might look something like arm64_darwin23_5_0
for an Apple M-series Mac, or x86_64_linux5_15_0
on an x86 Linux platform. The makefile creates a directory called $(EXT)
, and the object files generated are placed in that directory.1)
Standard targets defined are:
make depend
: createsMakefiles.dep
with dependencies.make
: this should build the executablemake install
: installs all files into$(ACT_HOME)
make clean
: removes object files but keeps all targets that were builtmake realclean
: removes targets as well (in addition to what is done with just clean).
1)
This was originally designed for Unix clusters with heterogeneous architectures but a shared file system.