File: Makefile

package info (click to toggle)
hcxdumptool 6.0.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 768 kB
  • sloc: ansic: 7,980; sh: 131; makefile: 72; xml: 4
file content (72 lines) | stat: -rw-r--r-- 1,422 bytes parent folder | download
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
68
69
70
71
72
PRODUCTION		:= 1
PRODUCTION_VERSION	:= 6.0.5
PRODUCTION_YEAR		:= 2020

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
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 hcxpioff hcxpioff.c $(LDFLAGS) -DVERSION_TAG=\"$(VERSION_TAG)\" -DVERSION_YEAR=\"$(VERSION_YEAR)\"
	$(CC) $(CFLAGS) $(CPPFLAGS) -o hcxdumptool hcxdumptool.c $(LDFLAGS) -lcrypto -lssl -DVERSION_TAG=\"$(VERSION_TAG)\" -DVERSION_YEAR=\"$(VERSION_YEAR)\"
else
	$(info OS not supported)
endif


install: build
ifeq ($(HOSTOS), Linux)
	install $(INSTFLAGS) hcxpioff $(INSTALLDIR)/hcxpioff
	install $(INSTFLAGS) hcxdumptool $(INSTALLDIR)/hcxdumptool
else
	$(info OS not supported)
endif


ifeq ($(HOSTOS), Linux)
	rm -f hcxpioff
	rm -f hcxdumptool
else
	$(info OS not supported)
endif
	rm -f *.o *~


clean:
ifeq ($(HOSTOS), Linux)
	rm -f hcxpioff
	rm -f hcxdumptool
else
	$(info OS not supported)
endif
	rm -f *.o *~


uninstall:
ifeq ($(HOSTOS), Linux)
	rm -f $(INSTALLDIR)/hcxpioff
	rm -f $(INSTALLDIR)/hcxdumptool
else
	$(info OS not supported)
endif