aboutsummaryrefslogtreecommitdiffstats
path: root/package/eeprog/eeprog.mk
blob: 98b9173dae6a1be836299c6643a6d29742764ee9 (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
#############################################################
#
# eeprog
#
#############################################################
EEPROG_VERSION:=0.7.6
EEPROG_SOURCE:=eeprog-$(EEPROG_VERSION).tar.gz
EEPROG_SITE:=http://codesink.org/download
EEPROG_DIR:=$(BUILD_DIR)/eeprog-$(EEPROG_VERSION)
EEPROG_BINARY:=eeprog
EEPROG_TARGET_BINARY:=usr/sbin/eeprog

$(DL_DIR)/$(EEPROG_SOURCE):
	 $(call DOWNLOAD,$(EEPROG_SITE),$(EEPROG_SOURCE))

eeprog-source: $(DL_DIR)/$(EEPROG_SOURCE)

$(EEPROG_DIR)/.unpacked: $(DL_DIR)/$(EEPROG_SOURCE)
	$(ZCAT) $(DL_DIR)/$(EEPROG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(EEPROG_DIR) package/eeprog/ eeprog\*.patch
	touch $(EEPROG_DIR)/.unpacked

$(EEPROG_DIR)/$(EEPROG_BINARY): $(EEPROG_DIR)/.unpacked
	$(MAKE) CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" -C $(EEPROG_DIR)
	$(STRIPCMD) $(EEPROG_DIR)/$(EEPROG_BINARY)

$(TARGET_DIR)/$(EEPROG_TARGET_BINARY): $(EEPROG_DIR)/$(EEPROG_BINARY)
	$(INSTALL) -m 0755 -D $(EEPROG_DIR)/$(EEPROG_BINARY) $(TARGET_DIR)/$(EEPROG_TARGET_BINARY)

eeprog: uclibc $(TARGET_DIR)/$(EEPROG_TARGET_BINARY)

eeprog-clean:
	rm -f $(TARGET_DIR)/$(EEPROG_TARGET_BINARY)
	-$(MAKE) -C $(EEPROG_DIR) clean

eeprog-dirclean:
	rm -rf $(EEPROG_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_EEPROG),y)
TARGETS+=eeprog
endif