diff --git a/README.md b/README.md index bb19e50..67aabb5 100644 --- a/README.md +++ b/README.md @@ -4,42 +4,30 @@

- - Last commit - - - + License - - - + Stars - - - + Issues - - - + Repo Size - - - + Zig workflow status - + />

@@ -54,11 +42,13 @@ [Foreword]: #foreword [Projects]: #projects [Extra tools/projects]: #extra-toolsprojects +[Building and packaging]: #building-and-packaging [Additional notes]: #additional-notes **[
 Foreword 
][Foreword]** **[
 Projects 
][Projects]** **[
 Extra tools/projects 
][Extra tools/projects]** +**[
 Building and packaging 
][Building and packaging]** **[
 Additional notes 
][Additional notes]**

@@ -67,8 +57,8 @@ ## Foreword -This is a [monorepo](https://en.wikipedia.org/wiki/Monorepo), meaning these -projects are tightly coupled and share dependencies to work properly. +This is a [monorepository](https://en.wikipedia.org/wiki/Monorepo), meaning +these projects are tightly coupled and share dependencies to work properly. **Why Zig instead of Make?** The 42 curriculum relies heavily on GNU Make to teach students the fundamentals of compilation. However, maintaining 30+ nearly @@ -240,9 +230,10 @@ somewhat incompatible with Nix, so I moved to the Zig build system. ### [`3DS port of cub3d`](/milestone-4/cub3d/3DS_README.md) -During a boring weekend, I set up a Bazel target to cross-compile a 3DS homebrew -app. If you have a modded 3DS on hand, you can compile it and try yourself. It's -very limited, laggy, and crashes on quit though. You have been warned. +During a boring weekend, I set up a Bazel[^1] target to cross-compile a 3DS +home-brew app. If you have a modded 3DS on hand, you can compile it and try +yourself. It's very limited, laggy, and crashes on quit though. You have been +warned. The level packaged is also very basic. ### [`Minecraft push_swap visualizer`](./tools/ps-viz-mc/README.md) @@ -257,22 +248,18 @@ and visualize the sorting algorithm on your `1.20.1` client. ### [`FDF generator`](./external-tools/fdf-bmp-converter/README.md) -A simple script to convert a BMP image into a fdf file. It currently only works -for bitmap images smaller than 255 \* 255, because I don't really know how to -reliably get the width of the image in the header. +A simple script to convert a BMP[^2] image into a fdf file. It currently only +works for bitmap images smaller than 255 \* 255, because I don't really know how +to reliably get the width of the image in the header. -You can convert PNG images to BMP using `convert` using -[ImageMagick](https://imagemagick.org/), or online with -[EzGIF](https://ezgif.com/png-to-bmp). +## Building and packaging -## Additional notes - -### Zig build +### Zig > [!NOTE] > Did you read the foreword? -You can build all the projects in this monorepo using +You can build all[^3] the projects in this monorepo using [Zig](https://ziglang.org/). - See the list of project in the [main build file](./build.zig). @@ -281,6 +268,18 @@ You can build all the projects in this monorepo using As per Zig fashion, building the entirety of the repo at once is pretty fast. +## Nix + +This project's dev dependencies are packaged using [Nix](https://nixos.org/) in +a `devShell` that I personally use with +[`nix-direnv`](https://github.com/nix-community/nix-direnv). There is a central +[`flake.nix`](./flake.nix) that loads all nix files using `import-tree`. + +I might eventually package the projects of this repo into this flake when I find +the time. + +## Additional notes + ### LSPs and `compile_commands.json` If you use an IDE or LSP server and the constant `clangd` type errors appearing @@ -289,7 +288,7 @@ when browsing this repo hurt your eyes, I might have a solution for you. The the headers, and in which order, and how your build system (Zig in this case) manages your compilation. -To compile this file for the whole project using Zig and Bear: +To compile this file for the whole project using Zig and Bear[^4]: ```sh bear -- zig build @@ -298,16 +297,23 @@ bear -- zig build > [!NOTE] > The `compile_commands.json` is gitignore'd for your inconvenience :-) -### nix-direnv - -This project's dev dependencies are managed using -[`nix-direnv`](https://github.com/nix-community/nix-direnv). There is a central -[`flake.nix`](./flake.nix) that loads all nix files using `import-tree`. - -I might eventually package the projects of this repo into this flake when I find -the time. - ## License This project is licensed under the [MIT License](/LICENSE). See the [LICENSE](/LICENSE) file for details. + +[^1]: I used to use Bazel to build my projects, but it's somewhat incompatible + with Nix, so I moved to the Zig build system. + +[^2]: You can convert PNG images to BMP using `convert` from + [ImageMagick](https://imagemagick.org/), or online with + [EzGIF](https://ezgif.com/png-to-bmp). + +[^3]: I haven't bothered to make _everything_ compile using the Zig build + system. At the time of writing and understandably, transcendence and the 3ds + cub3d port must be compiled individually with their own tooling. I don't + update the README as often as I update projects though, so take a look + around and see for yourself! + +[^4]: From [https://github.com/rizsotto/Bear](https://github.com/rizsotto/Bear): + "Bear generates a compilation database for Clang tooling." diff --git a/pcc/libasm/Makefile b/pcc/libasm/Makefile deleted file mode 100644 index 5f7d99b..0000000 --- a/pcc/libasm/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -NAME := libasm.a -AR := ar -ARFLAGS := rcs -AS := nasm -ASFLAGS := -f elf64 -Wall -Werror - -SRC := strlen strcpy strcmp write read strdup -SRC := $(addsuffix .s,$(addprefix src/ft_,$(SRC))) -OBJ := $(SRC:.s=.o) - -SRCB := atoi_base list_push_front list_size list_sort list_remove_if -SRCB := $(addsuffix _bonus.s,$(addprefix src/ft_,$(SRCB))) -OBJB := $(SRCB:.s=.o) - -TNAME := test -TSRC := test.c -# This tells the linker to create the ELF section and explicitly mark it as -# non-executable and non-allocating. Not including a '.note.GNU-stack' section -# in the assembly code implies executable stack. -TLDFLAGS := -Wl,-z,noexecstack - -all: $(NAME) - -bonus: $(NAME) $(OBJB) - $(AR) $(ARFLAGS) $(NAME) $(OBJB) - -$(NAME): $(OBJ) - $(AR) $(ARFLAGS) $(NAME) $(OBJ) - -%.o: %.s Makefile FORCE - $(AS) $(ASFLAGS) $< -o $@ - -clean: - $(RM) $(OBJ) $(OBJB) - -fclean: clean - $(RM) $(NAME) $(TNAME) - -re: fclean - $(MAKE) all - -$(TNAME): bonus $(NAME) - $(CC) $(TSRC) $(TLDFLAGS) $(NAME) -o $(TNAME) - -FORCE: - -.PHONY: all bonus clean fclean re test FORCE