Compare commits
No commits in common. "fda25171b2358c04b465eee79cb6cc23776fe186" and "19806ab0b599dbf63afb14784e8e683ac99a14d1" have entirely different histories.
fda25171b2
...
19806ab0b5
2 changed files with 8 additions and 15 deletions
7
Makefile
7
Makefile
|
|
@ -1,21 +1,16 @@
|
||||||
GITREV ?= $(shell git describe --dirty --always)
|
GITREV ?= $(shell git describe --dirty --always)
|
||||||
BLDDATE ?= $(shell date -I)
|
BLDDATE ?= $(shell date -I)
|
||||||
CR_YEAR ?= $(shell date +%Y)
|
CR_YEAR ?= $(shell date +%Y)
|
||||||
VERSION ?= "v0.1.2"
|
|
||||||
|
|
||||||
CFLAGS ?= -Wall -Wextra -Wpedantic -O2 -std=gnu99
|
CFLAGS ?= -Wall -Wextra -Wpedantic -O2 -std=gnu99
|
||||||
CFLAGS += -DGITREV='"$(GITREV)"'
|
CFLAGS += -DGITREV='"$(GITREV)"'
|
||||||
CFLAGS += -DBLDDATE='"$(BLDDATE)"'
|
CFLAGS += -DBLDDATE='"$(BLDDATE)"'
|
||||||
CFLAGS += -DCR_YEAR='"$(CR_YEAR)"'
|
CFLAGS += -DCR_YEAR='"$(CR_YEAR)"'
|
||||||
CFLAGS += -DVERSION='$(VERSION)'
|
|
||||||
|
|
||||||
# Soon...
|
# Soon...
|
||||||
# CFLAGS += $(shell pkg-config --cflags libudev)
|
# CFLAGS += $(shell pkg-config --cflags libudev)
|
||||||
# LIBS += $(shell pkg-config --libs libudev)
|
# LIBS += $(shell pkg-config --libs libudev)
|
||||||
|
|
||||||
PREFIX ?= /usr/local
|
|
||||||
DESTDIR ?=
|
|
||||||
|
|
||||||
writeimg: writeimg.c
|
writeimg: writeimg.c
|
||||||
$(CC) $(CFLAGS) $(LIBS) -o $@ $^
|
$(CC) $(CFLAGS) $(LIBS) -o $@ $^
|
||||||
|
|
||||||
|
|
@ -23,4 +18,4 @@ clean:
|
||||||
rm -f *.o writeimg
|
rm -f *.o writeimg
|
||||||
|
|
||||||
install: writeimg
|
install: writeimg
|
||||||
install -m 0755 $< $(DESTDIR)$(PREFIX)/bin/$<
|
install -m 0755 writeimg /usr/local/bin/writeimg
|
||||||
|
|
|
||||||
14
writeimg.c
14
writeimg.c
|
|
@ -10,12 +10,10 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifndef GITREV
|
#ifdef GITREV
|
||||||
#define GITREV "unknown"
|
#define VERSION GITREV
|
||||||
#endif
|
#else
|
||||||
|
#define VERSION "1.0.0"
|
||||||
#ifndef VERSION
|
|
||||||
#define VERSION "unknown"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CR_YEAR
|
#ifndef CR_YEAR
|
||||||
|
|
@ -129,11 +127,11 @@ static const struct option longopts[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
printf("%s %s, Rev. %s\n", basename(argv[0]), VERSION, GITREV);
|
printf("%s version %s\n", basename(argv[0]), VERSION);
|
||||||
fprintf(stdout, copyright, CR_YEAR);
|
|
||||||
#ifdef BLDDATE
|
#ifdef BLDDATE
|
||||||
printf("Build date: %s\n", BLDDATE);
|
printf("Build date: %s\n", BLDDATE);
|
||||||
#endif
|
#endif
|
||||||
|
fprintf(stdout, copyright, CR_YEAR);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
/* Line buffering, system allocated */
|
/* Line buffering, system allocated */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue