Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| guide:makefile [2024/07/18 13:47] – rajit | guide:makefile [2024/07/22 12:50] (current) – [Standard test cases] rajit | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== The standard ACT Makefile structure ====== | ====== The standard ACT Makefile structure ====== | ||
| + | |||
| + | The following is a simple '' | ||
| + | |||
| + | < | ||
| + | BINARY=example.$(EXT) | ||
| + | |||
| + | TARGETS=$(BINARY) | ||
| + | |||
| + | OBJS=main.o | ||
| + | SRCS=$(OBJS: | ||
| + | |||
| + | include $(ACT_HOME)/ | ||
| + | |||
| + | $(BINARY): $(LIB) $(OBJS) $(ACTPASSDEPEND) | ||
| + | $(CXX) $(CFLAGS) $(OBJS) -o $(BINARY) $(LIBACTPASS) | ||
| + | |||
| + | -include Makefile.deps | ||
| + | </ | ||
| + | |||
| + | The variable '' | ||
| + | |||
| + | Standard targets defined are: | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | The object files can be moved into the working directory using: | ||
| + | < | ||
| + | $ make move-in | ||
| + | </ | ||
| + | They can be put back into the architecture-specific directory using: | ||
| + | < | ||
| + | make move-out | ||
| + | </ | ||
| + | |||
| + | ===== Changing compilers ===== | ||
| + | |||
| + | The variables '' | ||
| + | So: | ||
| + | < | ||
| + | $ make CXX=clang++ | ||
| + | </ | ||
| + | will use clang++ as the C++ compiler for the build. | ||
| + | |||
| + | ===== Debug builds ===== | ||
| + | |||
| + | The C/C++ compilers are passed the '' | ||
| + | < | ||
| + | $ make C_COMPILER_FLAGS=-g | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Standard test cases ===== | ||
| + | |||
| + | Standard test cases can be run using: | ||
| + | < | ||
| + | $ make runtest | ||
| + | </ | ||
| + | |||
| + | For this to work properly, create test cases for your tool in the following way: | ||
| + | * All test cases and sample outputs are in the '' | ||
| + | * Test cases are run by changing to the '' | ||
| + | Take a look at examples from existing ACT tools (e.g. '' | ||