-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
67 lines (52 loc) · 1.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
PRODUCTION := 0
PRODUCTION_VERSION := 0.0.1
PRODUCTION_YEAR := 2024
ifeq ($(PRODUCTION),1)
VERSION_TAG := $(PRODUCTION_VERSION)
else
VERSION_TAG := $(shell git describe --tags || echo $(PRODUCTION_VERSION))
endif
VERSION_YEAR := $(shell echo $(PRODUCTION_YEAR))
PREFIX ?=/usr/local
INSTALLDIR = $(DESTDIR)$(PREFIX)/bin
HOSTOS := $(shell uname -s)
GPIOSUPPORT=off
CC ?= gcc
CFLAGS ?= -O3 -Wall -Wextra
CFLAGS += -std=gnu99
INSTFLAGS = -m 0755
ifeq ($(HOSTOS), Linux)
INSTFLAGS += -D
endif
all: build
build:
ifeq ($(HOSTOS), Linux)
$(CC) $(CFLAGS) $(CPPFLAGS) -o hcxbtdumptool hcxbtdumptool.c $(LDFLAGS) -lbluetooth -lcrypto -lssl -DVERSION_TAG=\"$(VERSION_TAG)\" -DVERSION_YEAR=\"$(VERSION_YEAR)\"
else
$(info OS not supported)
endif
install: build
ifeq ($(HOSTOS), Linux)
install $(INSTFLAGS) hcxbtdumptool $(INSTALLDIR)/hcxbtdumptool
else
$(info OS not supported)
endif
ifeq ($(HOSTOS), Linux)
rm -f hcxbtdumptool
else
$(info OS not supported)
endif
rm -f *.o *~
clean:
ifeq ($(HOSTOS), Linux)
rm -f hcxbtdumptool
else
$(info OS not supported)
endif
rm -f *.o *~
uninstall:
ifeq ($(HOSTOS), Linux)
rm -f $(INSTALLDIR)/hcxbtdumptool
else
$(info OS not supported)
endif