SMake is the build tool like make(UNIX) whose Makefile is written with S-expression.
Makefile.lsp:
<%
(let ((line nil))
(with-open-input-file (fd "Makefile.lsp")
(while (setq line (read-line fd nil nil))
(format (standard-output) "~a~%" line)
)
)
)
%>
Other examples:
- examples/cc/Makefile.lsp for C Project
Download the zipfile for your environment from Releases and unzip.
If you have the scoop-installer,
scoop install https://raw.githubusercontent.com/hymkor/smake/master/smake.json
or
scoop bucket add hymkor https://github.com/hymkor/scoop-bucket
scoop install smake
go build
If the file TARGET is newer than SOURCE or TARGET does not exist, execute COMMANDS.
The entry after MAINTARGET is evaluated when the TARGET equals the MAINTARGET or the TARGET is written on other evaluated SOURCES.
Expand the value of the variable written in the string-literal.
- "$(x)" to the value of the symbol x or the environment variable.
- "$<" is same as "$($<)"
- "$?" is same as "$($?)"
- "$@" is same as "$($@)"
- "$/" is same as "$($/)"
Execute the external executable directly. If it failes, top.
Execute the external executable directly and return its standard-output as string.
Execute the shell command by CMD.exe or /bin/sh. If it fails, stop.
Same as (sh) but ignores errors.
Execute the shell command and return its standard-output as string. Same as $(shell "..") of GNU Make.
Same as the UNIX command echo.
Same as the UNIX command rm.
Same as the UNIX command touch.
Return the value of the environment variable NAME. If it does not exist, return nil.
Set the environment variable "NAME" to "VALUE".
Set the environment variables and execute COMMANDS. Then, restores them to thier original values.
Expand PATTERNs as a wildcard and return them as a list.
Same as $(abspath FILEPATH) of GNU Make
Same as $(dir FILEPATH) of GNU Make
Same as $(notdir FILEPATH) of GNU Make
Same as $(basename FILEPATH) of GNU Make
Make path with "DIR"... "FNAME". (joinpath) is an alias of (pathjoin). Same as filepath.Join of golang.
If FILENAME exists, it returns t. Otherwise nil. Same as -e of Perl.
If DIRNAME exists and it is a directory, it returns t. Otherwise nil. Same as -d of Perl.
Change the current working directory to "DIRNAME"
Returns the current working directory.
Change the current directory to "DIRNAME" and execute COMMANDS like (progn). After COMMANDS, return to the original current directory.
Copy file SRC... to DST (directory or new filename)
Move file SRC... to DST (directory or new filename)
(string-split #\: "a:b:c")
=> ("a" "b" "c")
Call Windows-API: shellexecute
Split "STRING" with whilte-spaces. This function is similar with strings.Fields in golang
They are compatible functions with ISLisp. See also hymkor/gmnlisp
It is t
(true) when %OS% is Windows_NT
- $@ - the target filename
- $< - the first source filename
- $? - the updated source filenames
- $/ - OS-specific path separator (Windows \ , UNIX / )
- *args* - the command-line arguments
- $1...$9 - the same as (elt *args* N)
- $0 ... the current executing smake filename