-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.buildroot
46 lines (36 loc) · 1.35 KB
/
Makefile.buildroot
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
BR_EXT_PATH=$(PWD)
# buildroot output path, pleas find details in https://buildroot.org/downloads/manual/manual.html#_building_out_of_tree
BR_OUTPUT := $(BR_EXT_PATH)/output
COMMON_DEFS := -C buildroot O=$(BR_OUTPUT) BR2_EXTERNAL=$(BR_EXT_PATH)
DEFCONFIG := $(shell echo configs/*_defconfig)
KERNEL_CONFIG := $(shell echo configs/*_kernel.config)
BUSYBOX_CONFIG := $(shell echo configs/*_busybox.config)
BR_CONFIGS := $(DEFCONFIG) $(KERNEL_CONFIG) $(BUSYBOX_CONFIG)
ROOTFS_TAR := $(BR_OUTPUT)/images/rootfs.tar
DISK_IMG := images/disk.img
.PHONY: all
all: $(DISK_IMG)
$(DISK_IMG): $(ROOTFS_TAR)
@mkdir -p $(@D)
sh $(SH_VERBOSE) scripts/genimage.sh $@ $(BR_OUTPUT)
$(ROOTFS_TAR): .config
$(MAKE) $(COMMON_DEFS)
.PHONY: clean
clean:
$(MAKE) $(COMMON_DEFS) $@
#############################################################################
# buildroot targets wrapper
#############################################################################
.PHONY: menuconfig
menuconfig:
$(MAKE) $(COMMON_DEFS) nconfig BR2_CONFIG=$(abspath $(DEFCONFIG))
.PHONY: kernelconfig
kernelconfig: .config
$(MAKE) $(COMMON_DEFS) linux-menuconfig
cp build/linux-[0-9].*/.config $(KERNEL_CONFIG)
.PHONY: busyboxconfig
busyboxconfig: .config
$(MAKE) $(COMMON_DEFS) busybox-menuconfig
cp build/busybox-[0-9].*/.config $(BUSYBOX_CONFIG)
.config: $(BR_CONFIGS)
$(MAKE) $(COMMON_DEFS) $(<F)