3 .PHONY
:all dirs
clean am_i_root help uevent_monitor
20 OBJS
+= $(ULINUX_DEBUG_OBJS
)
24 @echo
"targets are 'all', 'help'(this output), 'clean', 'uevent_monitor'"
25 @echo
-e
"you can configure the build with the following variables:\\n\
26 SYSROOT, KERNEL_VERSION, ARCH, MODULES, SCSI_WAIT, CC, LD, CFLAGS, LDFLAGS\\n\
27 (you can tune the conf.mk file)"
29 all:am_i_root dirs ulinux
/arch
$(BUILD_DIR
)/initramfs.cpio.xz
32 @if
[ $$(whoami
) != root
];then echo
*ERROR
* must be root to build
;false
;fi
39 ln
-s archs
/$(ARCH
) ulinux
/arch
41 #===============================================================================
43 $(OBJ_DIR
)/mem.o
:ulinux
/arch
/utils
/mem.c
44 $(CC
) $(CFLAGS
) -c
$< -o
$@
46 $(OBJ_DIR
)/string.o
:ulinux
/utils
/ascii
/string
/string.c
47 $(CC
) $(CFLAGS
) -c
$< -o
$@
49 $(OBJ_DIR
)/vsprintf.o
:ulinux
/utils
/ascii
/string
/vsprintf.c
50 $(CC
) $(CFLAGS
) -c
$< -o
$@
52 #===============================================================================
54 $(CPIO_DIR
)/dev
/console
:
55 mknod
--mode
=0600 $(CPIO_DIR
)/dev
/console c
5 1
57 $(BUILD_DIR
)/initramfs.cpio
:$(CPIO_DIR
)/init
$(CPIO_DIR
)/dev
/console
58 chown
-R
0:0 $(CPIO_DIR
)
59 DEST_FILE
=$$(realpath
$(BUILD_DIR
))/initramfs.cpio
;\
61 find .
-depth
-print | cpio
--format
=newc
--create
>$${DEST_FILE}
63 $(BUILD_DIR
)/initramfs.cpio.xz
:$(BUILD_DIR
)/initramfs.cpio
64 xz
--force --check=crc32
--extreme
$<
66 $(OBJ_DIR
)/modules.o
:modules.c modules_list.h
67 $(CC
) $(CFLAGS
) -c
$< -o
$@
69 $(OBJ_DIR
)/init.o
:init.c modules.h
70 $(CC
) $(CFLAGS
) -c
$< -o
$@
72 $(CPIO_DIR
)/init
:$(OBJS
)
73 $(LD
) $(LDFLAGS
) $(OBJS
) --output
$@
76 .
/script
/modules_list.sh
>$@
83 #===============================================================================
84 $(BUILD_DIR
)/uevent_monitor
:uevent_monitor.c
$(ULINUX_DEBUG_OBJS
)
85 $(CC
) $(CFLAGS
) -c
$< -o
/tmp
/uevent_monitor.o
86 $(LD
) $(LDFLAGS
) /tmp
/uevent_monitor.o
$(ULINUX_DEBUG_OBJS
) --output
$@
88 uevent_monitor
:dirs ulinux
/arch
$(BUILD_DIR
)/uevent_monitor
89 #===============================================================================