-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
76 lines (54 loc) · 1.49 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
68
69
70
71
72
73
74
75
76
#
# Copyright (C) 2016 Jean-Christophe Rona <jc@rona.fr>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
GNU_PREFIX ?=
# Allow to create a static binary
STATIC ?= false
# Use an external implementation of iconv instead of the libc's one
USE_EXTERNAL_LIBICONV ?= false
# Enable Alsa support
ENABLE_ALSA ?= true
# Where to install the software
INSTALLATION_PATH ?= /usr/local/bin
# Where the configuration file should be placed
CONFIGURATION_FILE_LOCATION ?= /etc
CONFIGURATION_FILE = $(TARGET).conf
CFLAGS += -DCONFIG_FILE_LOCATION=\"$(CONFIGURATION_FILE_LOCATION)\"
ifeq ($(STATIC), true)
LDFLAGS += -static
endif
CC=$(GNU_PREFIX)gcc
LD=$(GNU_PREFIX)ld
LDLIBS = -lusb-1.0 -lpthread -lm
ifeq ($(USE_EXTERNAL_LIBICONV), true)
LDLIBS += -liconv
endif
ifeq ($(STATIC), true)
LDLIBS += -lgcc_eh
endif
TARGET = rf-ctrl
OBJECTS = he853.o ook-gpio.o sysfs-gpio.o dummy.o otax.o dio.o home-easy.o idk.o sumtech.o auchan.o auchan2.o somfy.o blyss.o rf-ctrl.o hid-libusb.o raw.o
ifeq ($(ENABLE_ALSA), true)
LDLIBS += -lasound
CFLAGS += -DALSA_ENABLED
OBJECTS += alsa.o
endif
all: $(TARGET)
$(TARGET): $(OBJECTS)
@echo
@echo -n "Linking ..."
@$(CC) $(CFLAGS) $(LDFLAGS) $+ -o $@ $(LDLIBS)
@echo " -> $@"
@echo
install:
install -D $(TARGET) $(INSTALLATION_PATH)
install -D $(CONFIGURATION_FILE) $(CONFIGURATION_FILE_LOCATION)
clean:
$(RM) $(OBJECTS) $(TARGET)
%.o : %.c
@echo "[$@] ..."
@$(CC) $(CFLAGS) -c $< -o $@
.PHONY: all clean