Skip to content

Repository files navigation

A shared Makefile to be use in CL projects

Makefile Configuration

To use this file first define the following variables in your makefile and then include cl.mk.

Variable NameDescriptionDefault value
PACKAGE_NAMEThe full name of the CL package
PACKAGE_NICKNAMEThe nickname of the CL package"$PACKAGE_NAME"
DOC_PACKAGESNames of the packages to document"$PACKAGE_NAME"
DOC_DEPSOptional additional Makefile doc targets
API_TITLETitle of the API section in the doc"$PACKAGE_NAME API"
API_NEXTTitle of the section after the API in the doc
API_PREVTitle of the section before the API in the doc
BINSNames of binaries to build with buildapp
TEST_ARTIFACTSName of dependencies for testing
TEST_BINSNames of lisp binaries needed for testing
TEST_BIN_DIRDirectory of the lisp binaries needed for testing
LISP_DEPSFiles required to build CL package
TEST_LISP_DEPSFiles required to build CL test package
BIN_TEST_DIRDirectory holding command line tests
BIN_TESTSList of command line tests
LONG_BIN_TESTSList of longer running command line tests
LISP_HEAPSize of the LISP heap (Mb)
LISP_STACKSize of the LISP stack (Mb)

An example usage would be the following Makefile.

.PHONY: doc
# Set personal or machine-local flags in a file named local.mkifneq ("$(wildcard local.mk)","")
include .cl-make/local.mk
endifPACKAGE_NAME = software-evolution
PACKAGE_NICKNAME = se
LISP_DEPS = \$(wildcard*.lisp)\$(wildcard src/*.lisp)\$(wildcard software/*.lisp)\$(wildcard utility/*.lisp)TEST_ARTIFACTS = \
test/etc/gcd/gcd \
test/etc/gcd/gcd.s
BINS = example-se-executable
include cl.mk
test/etc/gcd/gcd: test/etc/gcd/gcd.c
$(CC)$< -o $@test/etc/gcd/gcd.s: test/etc/gcd/gcd.c
$(CC)$< -S -o $@## Documentationdoc:
make -C doc

Building binaries

For each name in the BINS variable, a binary will be built with that name, which calls $PACKAGE_NICKNAME:$NAME as its main entry function.

Running tests

Your project should include a package named $PACKAGE_NICKNAME-test, which includes the functions run-batch (to run tests and print results to the console) and run-testbot (to run tests and submit results to datamanager).

The make targets $PACKAGE_NICKNAME-test, $PACKAGE_NICKNAME-testbot, check, and check-testbot are defined automatically. The first two are the test executables, and the last two will run the corresponding executable as well as building it.

Repository Configuration

It is probably best to include this project as a git submodule into your existing Common Lisp project git repository. The example Makefile above assumes that you have cloned this into the .cl-make/ sub-directory of your project, e.g. with the following:

git submodule add https://github.com/grammatech/cl-make.git .cl-make

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages