aboutsummaryrefslogtreecommitdiff
path: root/package/input-tools/input-tools.mk
blob: 020e1c9ed503f32b81603be3cc08941da68c26a7 (plain)
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
#############################################################
#
# input-tools
#
#############################################################

INPUT_TOOLS_VERSION:=20051019
INPUT_TOOLS_SOURCE:=joystick_$(INPUT_TOOLS_VERSION).orig.tar.gz
INPUT_TOOLS_PATCH:=joystick_$(INPUT_TOOLS_VERSION)-2.diff.gz
INPUT_TOOLS_SITE:=$(BR2_DEBIAN_MIRROR)/debian/pool/main/j/joystick/
INPUT_TOOLS_DIR:=$(BUILD_DIR)/joystick-$(INPUT_TOOLS_VERSION).orig
INPUT_TOOLS_CAT:=$(ZCAT)

INPUT_TOOLS_TARGETS-y:=

INPUT_TOOLS_TARGETS-$(BR2_PACKAGE_INPUT_TOOLS_EVTEST) += evtest
INPUT_TOOLS_TARGETS-$(BR2_PACKAGE_INPUT_TOOLS_INPUTATTACH) += inputattach
INPUT_TOOLS_TARGETS-$(BR2_PACKAGE_INPUT_TOOLS_JSCAL) += jscal
INPUT_TOOLS_TARGETS-$(BR2_PACKAGE_INPUT_TOOLS_JSTEST) += jstest

INPUT_TOOLS_TARGETS := $(addprefix $(TARGET_DIR)/usr/bin/, $(INPUT_TOOLS_TARGETS-y))
INPUT_TOOLS_SOURCES := $(addprefix $(INPUT_TOOLS_DIR)/utils/, \
	$(addsuffix .c, $(INPUT_TOOLS_TARGETS-y)))

$(DL_DIR)/$(INPUT_TOOLS_SOURCE):
	$(call DOWNLOAD,$(INPUT_TOOLS_SITE),$(@F))

$(DL_DIR)/$(INPUT_TOOLS_PATCH):
	$(call DOWNLOAD,$(INPUT_TOOLS_SITE),$(@F))

$(INPUT_TOOLS_DIR)/.unpacked: $(DL_DIR)/$(INPUT_TOOLS_SOURCE) $(DL_DIR)/$(INPUT_TOOLS_PATCH)
	$(INPUT_TOOLS_CAT) $(DL_DIR)/$(INPUT_TOOLS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
ifneq ($(INPUT_TOOLS_PATCH),)
	(cd $(INPUT_TOOLS_DIR) && $(INPUT_TOOLS_CAT) $(DL_DIR)/$(INPUT_TOOLS_PATCH) | patch -p1)
endif
	toolchain/patch-kernel.sh $(INPUT_TOOLS_DIR) package/input-tools/ \*.patch
	touch $@

$(INPUT_TOOLS_SOURCES): $(INPUT_TOOLS_DIR)/.unpacked

$(INPUT_TOOLS_DIR)/utils/%: $(INPUT_TOOLS_DIR)/utils/%.c
	$(TARGET_CC) $(TARGET_CFLAGS) -o $@ $^

$(INPUT_TOOLS_TARGETS): $(TARGET_DIR)/usr/bin/%: $(INPUT_TOOLS_DIR)/utils/%
	cp -dpf $^ $@
	$(STRIPCMD) $(STRIP_STRIP_ALL) $@

input-tools: uclibc $(INPUT_TOOLS_TARGETS)

input-tools-source: $(DL_DIR)/$(INPUT_TOOLS_SOURCE) $(DL_DIR)/$(INPUT_TOOLS_PATCH)

input-tools-unpacked: $(INPUT_TOOLS_DIR)/.unpacked

input-tools-clean:
	rm -f $(INPUT_TOOLS_TARGETS)

input-tools-dirclean:
	rm -rf $(INPUT_TOOLS_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_INPUT_TOOLS),y)
TARGETS+=input-tools
endif