Compare commits
2 commits
48dd623d7f
...
193103a981
Author | SHA1 | Date | |
---|---|---|---|
193103a981 | |||
309e919585 |
4 changed files with 67 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -52,3 +52,4 @@ Module.symvers
|
|||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
bin/
|
||||
|
|
37
Makefile
Normal file
37
Makefile
Normal file
|
@ -0,0 +1,37 @@
|
|||
.POSIX:
|
||||
.SUFFIXES:
|
||||
|
||||
CC=cc
|
||||
CFLAGS=-W -O
|
||||
|
||||
LDFLAGS=
|
||||
LDLIBS=
|
||||
|
||||
PREFIX=/usr/local
|
||||
|
||||
all: ensure_bin journal
|
||||
|
||||
ensure_bin: bin
|
||||
mkdir -p bin
|
||||
|
||||
install: journal
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f bin/journal $(DESTDIR)$(PREFIX)/bin
|
||||
|
||||
uninstall:
|
||||
rm $(DESTDIR)$(PREFIX)/bin/journal
|
||||
|
||||
# currently we only have one journal util, others may come later
|
||||
journal: src/journal/main.o
|
||||
$(CC) $(LDFLAGS) -o bin/journal src/journal/main.o $(LDLIBS)
|
||||
|
||||
src/journal/main.o: src/journal/main.c
|
||||
|
||||
clean:
|
||||
rm bin/journal src/journal/*.o
|
||||
|
||||
.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
|
||||
```
|
||||
|
|
15
src/journal/main.c
Normal file
15
src/journal/main.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if(argc < 2)
|
||||
{
|
||||
printf("usage: %s topic message\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *topic = argv[1];
|
||||
printf("%s\n", topic);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in a new issue