summaryrefslogtreecommitdiffstats
path: root/package/mkdosfs/mkdosfs.mk
blob: 0f8e71bd2f00ed8904408e00c5c06eab2e446426 (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
#############################################################
#
# mkdosfs
#
#############################################################
MKDOSFS_VERSION:=2.11
MKDOSFS_SOURCE:=dosfstools-$(MKDOSFS_VERSION).src.tar.gz
MKDOSFS_SITE:=http://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools
MKDOSFS_DIR:=$(BUILD_DIR)/dosfstools-$(MKDOSFS_VERSION)
MKDOSFS_CAT:=$(ZCAT)
MKDOSFS_BINARY:=mkdosfs/mkdosfs
MKDOSFS_TARGET_BINARY:=sbin/mkdosfs

MKDOSFS_CFLAGS=$(TARGET_CFLAGS)
ifeq ($(BR2_LARGEFILE),y)
MKDOSFS_CFLAGS+= -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
endif

$(DL_DIR)/$(MKDOSFS_SOURCE):
	 $(WGET) -P $(DL_DIR) $(MKDOSFS_SITE)/$(MKDOSFS_SOURCE)

mkdosfs-source: $(DL_DIR)/$(MKDOSFS_SOURCE)

$(MKDOSFS_DIR)/.unpacked: $(DL_DIR)/$(MKDOSFS_SOURCE)
	$(MKDOSFS_CAT) $(DL_DIR)/$(MKDOSFS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	touch $(MKDOSFS_DIR)/.unpacked

$(MKDOSFS_DIR)/$(MKDOSFS_BINARY): $(MKDOSFS_DIR)/.unpacked
	$(MAKE) CFLAGS="$(MKDOSFS_CFLAGS)" CC="$(TARGET_CC)" -C $(MKDOSFS_DIR)
	$(STRIP) $(MKDOSFS_DIR)/mkdosfs/mkdosfs
	touch -c $(MKDOSFS_DIR)/mkdosfs/mkdosfs

$(TARGET_DIR)/$(MKDOSFS_TARGET_BINARY): $(MKDOSFS_DIR)/$(MKDOSFS_BINARY)
	cp -a $(MKDOSFS_DIR)/$(MKDOSFS_BINARY) $(TARGET_DIR)/$(MKDOSFS_TARGET_BINARY)
	touch -c $(TARGET_DIR)/sbin/mkdosfs

mkdosfs: uclibc $(TARGET_DIR)/$(MKDOSFS_TARGET_BINARY)

mkdosfs-clean:
	$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(MKDOSFS_DIR) uninstall
	-$(MAKE) -C $(MKDOSFS_DIR) clean

mkdosfs-dirclean:
	rm -rf $(MKDOSFS_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_MKDOSFS)),y)
TARGETS+=mkdosfs
endif
OpenPOWER on IntegriCloud