initial commit, initial makefile
This commit is contained in:
parent
48dd623d7f
commit
309e919585
3 changed files with 47 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -52,3 +52,4 @@ Module.symvers
|
|||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
bin/
|
||||
|
|
31
Makefile
Normal file
31
Makefile
Normal file
|
@ -0,0 +1,31 @@
|
|||
.POSIX:
|
||||
.SUFFIXES:
|
||||
|
||||
CC=cc
|
||||
CFLAGS=-W -O
|
||||
|
||||
LDFLAGS=
|
||||
LDLIBS=
|
||||
|
||||
all: journal
|
||||
|
||||
install: journal
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f bin/journal $(DESTDIR)$(PREFIX)/bin
|
||||
|
||||
uninstall:
|
||||
rm $(DESTDIR)$(PREFIX)/bin/journal
|
||||
|
||||
# builds for the journal only, other utils might come on 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
|
||||
|
||||
clean:
|
||||
rm bin/journal src/journal/*.o
|
||||
|
||||
.SUFFIXES: .c .o
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
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