Skip to content

Commit

Permalink
Add Makefile, README: installation instructions as in the Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
BostX committed Oct 26, 2023
1 parent 668798f commit 880292f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# pipefail is not POSIX complaint

# Export these variables for all commands in this Makefile
# the 'export' seems not to be necessary
$(eval isGuix := $(shell command -v guix > /dev/null 2>&1 && echo t || echo f))
$(eval destDir := $(shell [ "${isGuix}" = t ] && echo $${dotf}/bin || echo ~/bin))

all: show-environment clean install-deps
[ ! -d ${destDir} ] && mkdir ${destDir} || :
raco exe -o ${destDir}/search-notes main.rkt
[ "${isGuix}" = t ] && gxhre --cores=${cores} || :

@# both can be used: ${...} also $(...)
@# commands must be terminated by '; \'
@# @if [ "$(isGuix)" = t ]; then \
# @# echo '# => $$isGuix: ${isGuix}; true branch'; \
# else \
# @# echo '# => $$isGuix: ${isGuix}; false branch'; \
# : ; \
# fi

show-environment:
@echo '### => $$isGuix: ${isGuix}'
@echo '### => $$destDir: ${destDir}'

install-deps:
@# without --skip-installed the this target fails.
raco pkg install --skip-installed --auto ansi-color

clean:
rm -rf ./compiled/ ./scribblings/compiled/

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
search-notes
============
Installation:
Installation: run `make`. See also Makefile.
```bash
# Fix the 'loading code: version mismatch' error
rm -rf ./compiled/ ./scribblings/compiled/
raco pkg install --auto ansi-color
command -v guix && destDir=$dotf/bin || destDir=~/bin
[ ! -d $destDir ] && mkdir $destDir
isGuix=$(command -v guix > /dev/null 2>&1 && echo t || echo f)
[ ${isGuix} = t ] && destDir=$dotf/bin || destDir=~/bin
[ ! -d ${destDir} ] && mkdir $destDir || :
raco exe -o $destDir/search-notes main.rkt
# gxhre --cores=24
[ ${isGuix} = t ] && gxhre --cores=${cores} || :
```

See main.rkt -> command-line -> #:usage-help
Expand Down

0 comments on commit 880292f

Please sign in to comment.