Update for 2009.05
[avatt.git] / package / setserial / setserial.mk
blob73ef6015e160a6bd1be2789d713760f073bc2a44
1 #############################################################
3 # Setserial
5 #############################################################
6 SETSERIAL_VERSION:=2.17
7 SETSERIAL_PATCH_VERSION:=.orig
8 SETSERIAL_PATCH_FILE:=setserial_2.17-45.diff.gz
9 SETSERIAL_SOURCE:=setserial_$(SETSERIAL_VERSION)$(SETSERIAL_PATCH_VERSION).tar.gz
10 SETSERIAL_SITE:=$(BR2_DEBIAN_MIRROR)/debian/pool/main/s/setserial/
11 SETSERIAL_DIR:=$(BUILD_DIR)/setserial-$(SETSERIAL_VERSION)
12 SETSERIAL_BINARY:=setserial
13 SETSERIAL_TARGET_BINARY:=usr/bin/setserial
15 $(DL_DIR)/$(SETSERIAL_SOURCE):
16 $(call DOWNLOAD,$(SETSERIAL_SITE),$(SETSERIAL_SOURCE))
18 ifneq ($(SETSERIAL_PATCH_FILE),)
19 SETSERIAL_PATCH:=$(DL_DIR)/$(SETSERIAL_PATCH_FILE)
20 $(SETSERIAL_PATCH):
21 $(call DOWNLOAD,$(SETSERIAL_SITE),$(SETSERIAL_PATCH_FILE))
22 else
23 SETSERIAL_PATCH:=
24 endif
26 $(SETSERIAL_DIR)/.unpacked: $(DL_DIR)/$(SETSERIAL_SOURCE) $(SETSERIAL_PATCH)
27 $(ZCAT) $(DL_DIR)/$(SETSERIAL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
28 $(CONFIG_UPDATE) $(SETSERIAL_DIR)
29 toolchain/patch-kernel.sh $(SETSERIAL_DIR) package/setserial setserial\*.patch
30 ifneq ($(SETSERIAL_PATCH_FILE),)
31 toolchain/patch-kernel.sh $(SETSERIAL_DIR) $(DL_DIR) $(SETSERIAL_PATCH_FILE)
32 if [ -d $(SETSERIAL_DIR)/debian/patches ]; then \
33 toolchain/patch-kernel.sh $(SETSERIAL_DIR) $(SETSERIAL_DIR)/debian/patches \*.patch; \
35 endif
36 touch $(SETSERIAL_DIR)/gorhack.h
37 touch $@
39 ifeq ($(BR2_PREFER_IMA),y)
40 SETSERIAL_CFLAGS=$(CFLAGS_COMBINE) $(CFLAGS_WHOLE_PROGRAM)
41 endif
43 $(SETSERIAL_DIR)/.configured: $(SETSERIAL_DIR)/.unpacked
44 (cd $(SETSERIAL_DIR); rm -rf config.cache; \
45 $(TARGET_CONFIGURE_OPTS) \
46 $(TARGET_CONFIGURE_ARGS) \
47 CFLAGS="$(TARGET_CFLAGS) $(SETSERIAL_CFLAGS)" \
48 ./configure \
49 --target=$(GNU_TARGET_NAME) \
50 --host=$(GNU_TARGET_NAME) \
51 --build=$(GNU_HOST_NAME) \
52 --prefix=/usr \
53 --sysconfdir=/etc \
55 touch $@
57 $(SETSERIAL_DIR)/$(SETSERIAL_BINARY): $(SETSERIAL_DIR)/.configured
58 $(MAKE) CC=$(TARGET_CC) -C $(SETSERIAL_DIR)
60 $(TARGET_DIR)/$(SETSERIAL_TARGET_BINARY): $(SETSERIAL_DIR)/$(SETSERIAL_BINARY)
61 install -c $(SETSERIAL_DIR)/$(SETSERIAL_BINARY) $(TARGET_DIR)/$(SETSERIAL_TARGET_BINARY)
62 $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/$(SETSERIAL_TARGET_BINARY)
64 setserial: uclibc $(TARGET_DIR)/$(SETSERIAL_TARGET_BINARY)
66 setserial-source: $(DL_DIR)/$(SETSERIAL_SOURCE) $(SETSERIAL_PATCH)
68 setserial-unpacked: $(SETSERIAL_DIR)/.unpacked
70 setserial-clean:
71 rm -f $(TARGET_DIR)/$(SETSERIAL_TARGET_BINARY)
72 -$(MAKE) -C $(SETSERIAL_DIR) clean
74 setserial-dirclean:
75 rm -rf $(SETSERIAL_DIR)
77 #############################################################
79 # Toplevel Makefile options
81 #############################################################
82 ifeq ($(BR2_PACKAGE_SETSERIAL),y)
83 TARGETS+=setserial
84 endif