makefile: add PREFIX and ensure_bin target
- add build/install instructions
This commit is contained in:
parent
309e919585
commit
193103a981
2 changed files with 23 additions and 4 deletions
12
Makefile
12
Makefile
|
@ -7,7 +7,12 @@ CFLAGS=-W -O
|
|||
LDFLAGS=
|
||||
LDLIBS=
|
||||
|
||||
all: journal
|
||||
PREFIX=/usr/local
|
||||
|
||||
all: ensure_bin journal
|
||||
|
||||
ensure_bin: bin
|
||||
mkdir -p bin
|
||||
|
||||
install: journal
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
|
@ -16,9 +21,8 @@ install: journal
|
|||
uninstall:
|
||||
rm $(DESTDIR)$(PREFIX)/bin/journal
|
||||
|
||||
# builds for the journal only, other utils might come on later
|
||||
# currently we only have one journal util, others may come later
|
||||
journal: src/journal/main.o
|
||||
mkdir -p bin
|
||||
$(CC) $(LDFLAGS) -o bin/journal src/journal/main.o $(LDLIBS)
|
||||
|
||||
src/journal/main.o: src/journal/main.c
|
||||
|
@ -28,4 +32,6 @@ clean:
|
|||
|
||||
.SUFFIXES: .c .o
|
||||
.c.o:
|
||||
# $< mean the prereqs
|
||||
# $@ means the target
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
|
15
README.md
15
README.md
|
@ -1,3 +1,16 @@
|
|||
# lunabot
|
||||
|
||||
journal-like util for me
|
||||
journal-like util for me
|
||||
|
||||
## building
|
||||
|
||||
- a robot girl
|
||||
- posix compliant make
|
||||
- gcc/any cc
|
||||
|
||||
```
|
||||
make
|
||||
|
||||
# or just remove PREFIX for /usr/local
|
||||
make PREFIX=$HOME/.local install
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue