summaryrefslogtreecommitdiffstats
path: root/package/devmem2/devmem2.mk
blob: 457a18102025f0bd76795aadfe55b8d5cc4e5650 (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
#############################################################
#
# devmem2
#
#############################################################

DEVMEM2_SOURCE:=devmem2.c
DEVMEM2_SITE:=http://free-electrons.com/pub/mirror
DEVMEM2_BINARY:=devmem2
DEVMEM2_DIR:=$(BUILD_DIR)/devmem2

$(DL_DIR)/$(DEVMEM2_SOURCE):
	$(call DOWNLOAD,$(DEVMEM2_SITE),$(DEVMEM2_SOURCE))

$(DEVMEM2_DIR)/$(DEVMEM2_SOURCE): $(DL_DIR)/$(DEVMEM2_SOURCE)
	mkdir -p $(@D)
	cp $^ $@

$(DEVMEM2_DIR)/$(DEVMEM2_BINARY): $(DEVMEM2_DIR)/$(DEVMEM2_SOURCE)
	$(TARGET_CC) $(TARGET_CFLAGS) -o $@ $^

$(TARGET_DIR)/sbin/$(DEVMEM2_BINARY): $(DEVMEM2_DIR)/$(DEVMEM2_BINARY)
	cp $^ $@
	$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@

devmem2: $(TARGET_DIR)/sbin/$(DEVMEM2_BINARY)

devmem2-source: $(DL_DIR)/$(DEVMEM2_SOURCE)

devmem2-clean:
	rm -f $(TARGET_DIR/sbin/$(DEVMEM2_BINARY)

devmem2-dirclean:
	rm -rf $(DEVMEM2_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_DEVMEM2),y)
TARGETS+=devmem2
endif