/makefile (3e39461f8632630c486a6d15a78e18574cd3c7f9) (1938 bytes) (mode 100644) (type blob)
include conf.mk
.PHONY:all dirs clean am_i_root help
DIRS=\
$(OBJ_DIR) \
$(MODULES_DIR) \
$(CPIO_DIR)/dev
OBJS=\
$(OBJ_DIR)/init.o \
$(OBJ_DIR)/modules.o
ifdef DEBUG
ULINUX_DEBUG_OBJS=\
$(OBJ_DIR)/mem.o \
$(OBJ_DIR)/string.o \
$(OBJ_DIR)/vsprintf.o
OBJS+= $(ULINUX_DEBUG_OBJS)
endif
help:
@echo "targets are 'all', 'help'(this output), 'clean'"
@echo -e "you can configure the build with the following variables:\\n\
SYSROOT, KERNEL_VERSION, ARCH, MODULES, SCSI_WAIT, CC, LD, CFLAGS, LDFLAGS\\n\
(you can tune the conf.mk file)"
all:am_i_root dirs ulinux/arch $(BUILD_DIR)/initramfs.cpio.xz
am_i_root:
@if [ $$(whoami) != root ];then echo *ERROR* must be root to build;false;fi
dirs:$(DIRS)
$(DIRS):
-mkdir -p $@
ulinux/arch:
ln -s archs/$(ARCH) ulinux/arch
#===============================================================================
ifdef DEBUG
$(OBJ_DIR)/mem.o:ulinux/arch/utils/mem.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJ_DIR)/string.o:ulinux/utils/ascii/string/string.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJ_DIR)/vsprintf.o:ulinux/utils/ascii/string/vsprintf.c
$(CC) $(CFLAGS) -c $< -o $@
endif
#===============================================================================
$(CPIO_DIR)/dev/console:
mknod --mode=0600 $(CPIO_DIR)/dev/console c 5 1
$(BUILD_DIR)/initramfs.cpio:$(CPIO_DIR)/init $(CPIO_DIR)/dev/console
chown -R 0:0 $(CPIO_DIR)
DEST_FILE=$$(realpath $(BUILD_DIR))/initramfs.cpio;\
cd $(CPIO_DIR);\
find . -depth -print | cpio --format=newc --create >$${DEST_FILE}
$(BUILD_DIR)/initramfs.cpio.xz:$(BUILD_DIR)/initramfs.cpio
xz --force --check=crc32 --extreme $<
$(OBJ_DIR)/modules.o:modules.c modules_list.h
$(CC) $(CFLAGS) -c $< -o $@
$(OBJ_DIR)/init.o:init.c modules.h
$(CC) $(CFLAGS) -c $< -o $@
$(CPIO_DIR)/init:$(OBJS)
$(LD) $(LDFLAGS) $(OBJS) --output $@
modules_list.h:
./script/modules_list.sh >$@
clean:
-rm -f ulinux/arch
-rm -Rf $(BUILD_DIR)
-rm -f modules_list.h
Mode |
Type |
Size |
Ref |
File |
100644 |
blob |
279 |
467ddb5b4b0f002ff0eca0a95df378216f88d238 |
README |
100644 |
blob |
623 |
0fb75b9826820260cb53c4be9d8304faf8ebba30 |
conf.mk |
100644 |
blob |
721 |
02f31ff0c12bb726237501a97aba616763f58fc8 |
globals.h |
100644 |
blob |
1541 |
60a011322774c0b002e5733cd8d54cdd57ba0684 |
init.c |
100644 |
blob |
1938 |
3e39461f8632630c486a6d15a78e18574cd3c7f9 |
makefile |
100644 |
blob |
1371 |
63757ddf9f9360682b35599af6b423cd2eb594a9 |
modules.c |
100644 |
blob |
406 |
f5e162a64baf80fef122ef374b138aa50fc4158b |
modules.h |
040000 |
tree |
- |
411cf6aace0ae666b41cecc267da82828eba511d |
script |
040000 |
tree |
- |
653bc408259cdb6ab6e5d4fe0dbf250c38790ade |
ulinux |
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/sylware/cinitramfs
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/sylware/cinitramfs
Clone this repository using git:
git clone git://git.rocketgit.com/user/sylware/cinitramfs
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main