Build tools on macOS and allow install-tools
This commit is contained in:
@@ -19,7 +19,7 @@ CFLAGS = -Wall -Wextra -Werror -std=c99 -O3 -fPIC -I Keccak -I $(FTDILOCI) \
|
|||||||
|
|
||||||
RM=rm
|
RM=rm
|
||||||
|
|
||||||
all: libinfnoise.a libinfnoise.so infnoise
|
all: libinfnoise.a libinfnoise.so infnoise tools.stamp
|
||||||
|
|
||||||
infnoise: libinfnoise.a infnoise.o daemon.o
|
infnoise: libinfnoise.a infnoise.o daemon.o
|
||||||
$(CC) $(CFLAGS) -o infnoise infnoise.o daemon.o libinfnoise.a $(FTDI) -lm -L. -L $(FTDILOCL)
|
$(CC) $(CFLAGS) -o infnoise infnoise.o daemon.o libinfnoise.a $(FTDI) -lm -L. -L $(FTDILOCL)
|
||||||
@@ -45,15 +45,19 @@ libinfnoise.so: libinfnoise.o healthcheck.o KeccakF-1600-reference.o
|
|||||||
|
|
||||||
libs: libinfnoise.a
|
libs: libinfnoise.a
|
||||||
|
|
||||||
|
tools.stamp:
|
||||||
|
$(MAKE) -C tools all
|
||||||
|
touch tools.stamp
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -f infnoise *.o *.a *.gch *.so libinfnoise-example
|
$(RM) -f infnoise *.o *.a *.gch *.so libinfnoise-example tools.stamp
|
||||||
|
$(MAKE) -C tools clean
|
||||||
|
|
||||||
install-lib: libinfnoise.so
|
install-lib: libinfnoise.so
|
||||||
install -d $(PREFIX)/include
|
install -d $(PREFIX)/include
|
||||||
install -m 0644 libinfnoise.h $(PREFIX)/include
|
install -m 0644 libinfnoise.h $(PREFIX)/include
|
||||||
install -d $(PREFIX)/lib
|
install -d $(PREFIX)/lib
|
||||||
install -m 0644 libinfnoise.so $(PREFIX)/lib
|
install -m 0644 libinfnoise.so $(PREFIX)/lib
|
||||||
ldconfig $(PREFIX)/lib
|
|
||||||
|
|
||||||
install: infnoise
|
install: infnoise
|
||||||
install -d $(PREFIX)/sbin
|
install -d $(PREFIX)/sbin
|
||||||
@@ -63,6 +67,6 @@ install: infnoise
|
|||||||
install -d $(PREFIX)/lib/systemd/system
|
install -d $(PREFIX)/lib/systemd/system
|
||||||
install -m 0644 init_scripts/infnoise.service $(PREFIX)/lib/systemd/system
|
install -m 0644 init_scripts/infnoise.service $(PREFIX)/lib/systemd/system
|
||||||
|
|
||||||
postinstall:
|
install-tools: install tools.stamp
|
||||||
systemctl restart systemd-udevd
|
install -d $(PREFIX)/bin
|
||||||
systemctl enable infnoise
|
install -m 0755 tools/bin2hex tools/dice tools/entcheck tools/findlongest tools/flipbits tools/healthcheck tools/hex2bin tools/passgen $(PREFIX)/bin/
|
||||||
@@ -1,4 +1,10 @@
|
|||||||
CFLAGS=-Wall -Wextra -Werror -std=c99 -O3 -I /usr/include/libftdi1
|
CFLAGS=-Wall -Wextra -Werror -std=c99 -O3 -I $(shell brew --prefix libftdi || echo /usr)/include/libftdi1
|
||||||
|
UNAME_S := $(shell uname -s)
|
||||||
|
ifeq ($(UNAME_S),Darwin)
|
||||||
|
LIBRT=
|
||||||
|
else
|
||||||
|
LIBRT=-lrt
|
||||||
|
endif
|
||||||
|
|
||||||
all: passgen healthcheck findlongest entcheck hex2bin bin2hex flipbits dice
|
all: passgen healthcheck findlongest entcheck hex2bin bin2hex flipbits dice
|
||||||
|
|
||||||
@@ -6,10 +12,10 @@ passgen: passgen.c
|
|||||||
$(CC) $(CFLAGS) -o passgen passgen.c -lm
|
$(CC) $(CFLAGS) -o passgen passgen.c -lm
|
||||||
|
|
||||||
healthcheck: ../healthcheck.c
|
healthcheck: ../healthcheck.c
|
||||||
$(CC) $(CFLAGS) -D TEST_HEALTHCHECK -o healthcheck ../healthcheck.c -lm -lrt
|
$(CC) $(CFLAGS) -D TEST_HEALTHCHECK -o healthcheck ../healthcheck.c -lm $(LIBRT)
|
||||||
|
|
||||||
entcheck: entcheck.c
|
entcheck: entcheck.c
|
||||||
$(CC) $(CFLAGS) -o entcheck entcheck.c -lm -lrt
|
$(CC) $(CFLAGS) -o entcheck entcheck.c -lm $(LIBRT)
|
||||||
|
|
||||||
findlongest: findlongest.c
|
findlongest: findlongest.c
|
||||||
$(CC) $(CFLAGS) -o findlongest findlongest.c
|
$(CC) $(CFLAGS) -o findlongest findlongest.c
|
||||||
|
|||||||
Reference in New Issue
Block a user