build: mise à jour des makefile pour indent correct et permissions/format harmonisé
This commit is contained in:
parent
524af1729c
commit
6cdfbcdd28
31
lib/makefile
31
lib/makefile
|
@ -2,10 +2,15 @@ CC=gcc -O0 -g -nostdinc -ffreestanding -fno-builtin -Wall -w -m32 -F elf_i386 -f
|
|||
LINK=ld -m elf_i386 -r -o
|
||||
SRCS= $(wildcard *.c)
|
||||
OBJS= $(SRCS:.c=.o)
|
||||
CONVERT=dos2unix
|
||||
INDENT=indent -nhnl -l75 -ppi3 -ts8 -bls -nbc -di8 -nbad -nbap -nsob -i8 -bl -bli0 -ncdw -nce -cli8 -cbi0 -npcs -cs -saf -sai -saw -nprs -lp -npsl
|
||||
REMOVE=rm -f
|
||||
CHANGEPERM=chmod 644
|
||||
|
||||
all: makeall
|
||||
all: libs.o
|
||||
sync
|
||||
|
||||
makeall: libs.o
|
||||
togit: clean indent clean
|
||||
|
||||
libs.o:$(OBJS)
|
||||
$(LINK) libs.o $(OBJS)
|
||||
|
@ -14,10 +19,20 @@ libs.o:$(OBJS)
|
|||
$(CC) $^
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f *.c~
|
||||
rm -f ./VGA/*.c~
|
||||
$(REMOVE) *.o
|
||||
$(REMOVE) *.c~
|
||||
$(REMOVE) */*.c~
|
||||
$(REMOVE) ../include/*.h~
|
||||
sync
|
||||
|
||||
indent:
|
||||
indent -linux -i8 -ts8 *.c
|
||||
indent -linux -i8 -ts8 ./VGA/*.c
|
||||
indent:
|
||||
$(CHANGEPERM) *.c
|
||||
$(CONVERT) *.c
|
||||
$(INDENT) *.c
|
||||
$(CHANGEPERM) ./*/*.c
|
||||
$(CONVERT) ./*/*.c
|
||||
$(INDENT) ./*/*.c
|
||||
$(CHANGEPERM) ../include/*.h
|
||||
$(CONVERT) ../include/*.h
|
||||
$(INDENT) ../include/*.h
|
||||
sync
|
||||
|
|
9
makefile
9
makefile
|
@ -21,6 +21,14 @@ uefi: final/harddiskuefi.img.final
|
|||
install:
|
||||
(sudo apt-get install nasm gcc qemu fusefat fuseext2 cgdb ovmf bsdmainutils tar bsdmainutils indent binutils bochs bochs-x bochsbios)
|
||||
|
||||
togit:
|
||||
make -C system togit
|
||||
make -C lib togit
|
||||
make -C final togit
|
||||
make -C programs togit
|
||||
git status
|
||||
sync
|
||||
|
||||
clean:
|
||||
make -C system clean
|
||||
make -C lib clean
|
||||
|
@ -38,6 +46,7 @@ littleclean:
|
|||
indent:
|
||||
make -C system indent
|
||||
make -C lib indent
|
||||
make -C programs indent
|
||||
sync
|
||||
|
||||
backup: clean
|
||||
|
|
|
@ -3,10 +3,15 @@ LINK=ld -m elf_i386 -r -o
|
|||
SRCS= $(wildcard *.c)
|
||||
OBJS= $(SRCS:.c=.o)
|
||||
ARCH=ar rcs
|
||||
CONVERT=dos2unix
|
||||
INDENT=indent -nhnl -l75 -ppi3 -ts8 -bls -nbc -di8 -nbad -nbap -nsob -i8 -bl -bli0 -ncdw -nce -cli8 -cbi0 -npcs -cs -saf -sai -saw -nprs -lp -npsl
|
||||
REMOVE=rm -f
|
||||
CHANGEPERM=chmod 644
|
||||
|
||||
all: makeall
|
||||
all: libs.a
|
||||
sync
|
||||
|
||||
makeall: libs.a
|
||||
togit: clean indent clean
|
||||
|
||||
libs.a:libs.o
|
||||
$(ARCH) $@ $^
|
||||
|
@ -18,9 +23,16 @@ libs.o:$(OBJS)
|
|||
$(CC) $^
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f *.c~
|
||||
rm -f *.a
|
||||
$(REMOVE) *.o
|
||||
$(REMOVE) *.c~
|
||||
$(REMOVE) *.a
|
||||
sync
|
||||
|
||||
indent:
|
||||
indent -linux -i8 -ts8 *.c
|
||||
$(CHANGEPERM) *.c
|
||||
$(CONVERT) *.c
|
||||
$(INDENT) *.c
|
||||
$(CHANGEPERM) ../include/*.h
|
||||
$(CONVERT) ../include/*.h
|
||||
$(INDENT) ../include/*.h
|
||||
sync
|
||||
|
|
|
@ -2,8 +2,16 @@ CC=gcc -O0 -g -nostdinc -ffreestanding -fno-builtin -Wall -w -m32 -I ./include -
|
|||
LINK=ld -m elf_i386 -T linker.lds -n -o
|
||||
SRCS= $(wildcard *.c)
|
||||
EXECS= $(SRCS:.c=)
|
||||
CONVERT=dos2unix
|
||||
INDENT=indent -nhnl -l75 -ppi3 -ts8 -bls -nbc -di8 -nbad -nbap -nsob -i8 -bl -bli0 -ncdw -nce -cli8 -cbi0 -npcs -cs -saf -sai -saw -nprs -lp -npsl
|
||||
REMOVE=rm -f
|
||||
CHANGELF=elfedit --output-osabi FenixOS
|
||||
CHANGEPERM=chmod 644
|
||||
|
||||
all: lib/libs.a $(EXECS)
|
||||
sync
|
||||
|
||||
togit: clean indent clean
|
||||
|
||||
lib/libs.a:
|
||||
make -C lib
|
||||
|
@ -11,14 +19,19 @@ lib/libs.a:
|
|||
%: %.c
|
||||
$(CC) $@.o $<
|
||||
$(LINK) $@ $@.o lib/libs.a
|
||||
chmod 644 $@
|
||||
elfedit --output-osabi FenixOS $@
|
||||
$(CHANGEPERM) $@
|
||||
$(CHANGELF) $@
|
||||
|
||||
clean:
|
||||
make -C lib clean
|
||||
rm -f *.o
|
||||
rm -f *.c~
|
||||
find . -type f ! -perm /u=x -maxdepth 1 -regex '.+/\.?[^\.]+' -exec rm {} \;
|
||||
$(REMOVE) *.o
|
||||
$(REMOVE) *.c~
|
||||
find . -type f ! -perm /u=x -maxdepth 1 -regex '.+/\.?[^\.]+' -exec $(REMOVE) {} \;
|
||||
sync
|
||||
|
||||
indent:
|
||||
indent -linux -i8 -ts8 *.c
|
||||
make -C lib indent
|
||||
$(CHANGEPERM) *.c
|
||||
$(CONVERT) *.c
|
||||
$(INDENT) *.c
|
||||
sync
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
GCC=gcc -O0 -g -nostdinc -ffreestanding -fno-builtin -Wall -w -I ../include -m32 -fno-pie -no-pie -c -o
|
||||
ASM=nasm
|
||||
ASM=nasm -f elf -o
|
||||
LINK=ld -m elf_i386 -T linker.lds -n -o
|
||||
CONVERT=dos2unix
|
||||
INDENT=indent -nhnl -l75 -ppi3 -ts8 -bls -nbc -di8 -nbad -nbap -nsob -i8 -bl -bli0 -ncdw -nce -cli8 -cbi0 -npcs -cs -saf -sai -saw -nprs -lp -npsl
|
||||
REMOVE=rm -f
|
||||
CHANGEPERM=chmod 644
|
||||
|
||||
all: system.sys
|
||||
sync
|
||||
|
||||
togit: clean indent clean
|
||||
|
||||
system.sys: multiboot.o system.o ../lib/libs.o
|
||||
$(LINK) system.sys multiboot.o system.o ../lib/libs.o
|
||||
|
||||
|
@ -12,15 +18,19 @@ system.o:
|
|||
$(GCC) system.o system.c
|
||||
|
||||
multiboot.o:
|
||||
$(ASM) -f elf -o multiboot.o multiboot.asm -dVESA=$(VESA)
|
||||
$(ASM) multiboot.o multiboot.asm -dVESA=$(VESA)
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f *.out
|
||||
rm -f *.bin
|
||||
rm -f *.sys
|
||||
rm -f *.s
|
||||
rm -f *.c~
|
||||
$(REMOVE) *.o
|
||||
$(REMOVE) *.out
|
||||
$(REMOVE) *.bin
|
||||
$(REMOVE) *.sys
|
||||
$(REMOVE) *.s
|
||||
$(REMOVE) *.c~
|
||||
sync
|
||||
|
||||
indent:
|
||||
indent -linux -i8 -ts8 *.c
|
||||
indent:
|
||||
$(CHANGEPERM) *.c
|
||||
$(CONVERT) *.c
|
||||
$(INDENT) *.c
|
||||
sync
|
||||
|
|
Loading…
Reference in New Issue