adds a script to generate a clangd file for editor usage
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@ bochslog.txt
|
||||
*.iso
|
||||
*.a
|
||||
*.elf
|
||||
.clangd
|
||||
|
6
Makefile
6
Makefile
@ -27,10 +27,13 @@ libk_objs = $(free_objs)
|
||||
# binaries = libk.a libc.a # Not ready for libc yet
|
||||
binaries = libk.a
|
||||
|
||||
.PHONY: clean all run install-headers install-libs
|
||||
.PHONY: clean all run install-headers install-libs env
|
||||
|
||||
all: kernel.elf
|
||||
|
||||
env: install-headers install-libs
|
||||
util/./gen-clangd.sh
|
||||
|
||||
kernel.elf: install-headers install-libs $(c_kern_objects) $(asm_kern_objects)
|
||||
$(CC) $(CFLAGS) -T $(shell find . -name "link.ld") -o $@ $(c_kern_objects) $(asm_kern_objects) -nostdlib -lk -lgcc
|
||||
|
||||
@ -65,3 +68,4 @@ clean:
|
||||
-rm $(shell find . -name "*.o")
|
||||
-rm $(shell find . -name "*.d")
|
||||
-rm *.iso *.elf *.a com1.out bochslog.txt
|
||||
-rm .clangd
|
||||
|
@ -5,16 +5,9 @@
|
||||
|
||||
#define EOF (-1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int printf(const char* __restrict, ...);
|
||||
int putchar(int);
|
||||
int puts(const char*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
15
util/gen-clangd.sh
Executable file
15
util/gen-clangd.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This must be built with `make env` in the root folder
|
||||
# otherwises the paths will be incorrect
|
||||
|
||||
echo "CompileFlags:
|
||||
Add:
|
||||
- \"--sysroot=$(pwd)/sysroot\"
|
||||
- \"-ffreestanding\"
|
||||
- \"-Wpedantic\"
|
||||
- \"-Werror\"
|
||||
- \"-Wall\"
|
||||
- \"-Wextra\"
|
||||
" > .clangd
|
||||
|
Reference in New Issue
Block a user