WORKING_DIR = $(shell pwd) CROSS_DIR=$(WORKING_DIR)/cross export PATH := $(CROSS_DIR):$(PATH) QEMU_VERSION = qemu-7.1.0 all: do_rep do_ep do_fex do_limine clone_all do_binutils_64 do_gcc_64 do_binutils_32 do_gcc_32 do_qemu clean: rm -f rep ep fex do_rep: gcc -w ReadEthernetPackets.c -o rep chmod +x rep do_ep: g++ -w ErrorParser.cpp -o ep chmod +x ep do_fex: gcc -w Fex.c -o fex chmod +x fex do_limine: git clone https://github.com/limine-bootloader/limine.git --branch=v4.x-branch-binary --depth=1 clone_all: git clone https://github.com/Fennix-Project/binutils-gdb.git binutils-gdb git clone https://github.com/Fennix-Project/gcc.git gcc wget https://download.qemu.org/${QEMU_VERSION}.tar.xz tar xvJf ${QEMU_VERSION}.tar.xz rm -f ${QEMU_VERSION}.tar.xz mv ${QEMU_VERSION} qemu mkdir -p cross mkdir -p qemu mkdir -p build-binutils64 mkdir -p build-gcc64 mkdir -p build-binutils32 mkdir -p build-gcc32 __clone_all_no_qemu: git clone https://github.com/Fennix-Project/binutils-gdb.git binutils-gdb git clone https://github.com/Fennix-Project/gcc.git gcc mkdir -p cross mkdir -p build-binutils64 mkdir -p build-gcc64 mkdir -p build-binutils32 mkdir -p build-gcc32 do_qemu: cd qemu && \ bash ./configure --target-list=x86_64-softmmu,i386-softmmu,aarch64-softmmu --prefix="$(CROSS_DIR)" --enable-gtk && \ make -j$(shell nproc) && make install do_binutils_64: cd build-binutils64 && \ ../binutils-gdb/configure --target=x86_64-fennix --prefix="$(CROSS_DIR)" --with-sysroot --enable-shared --disable-werror && \ make all -j$(shell nproc) && make install do_gcc_64: cd build-gcc64 && \ ../gcc/configure --target=x86_64-fennix --prefix="$(CROSS_DIR)" --enable-languages=c,c++ --enable-shared --without-headers && \ make all-gcc -j$(shell nproc) && \ make all-target-libgcc -j$(shell nproc) && \ make install-gcc -j$(shell nproc) && \ make install-target-libgcc -j$(shell nproc) do_binutils_32: cd build-binutils32 && \ ../binutils-gdb/configure --target=i386-fennix --prefix="$(CROSS_DIR)" --with-sysroot --enable-shared --disable-werror && \ make all -j$(shell nproc) && make install do_gcc_32: cd build-gcc32 && \ ../gcc/configure --target=i386-fennix --prefix="$(CROSS_DIR)" --enable-languages=c,c++ --enable-shared --without-headers && \ make all-gcc -j$(shell nproc) && \ make all-target-libgcc -j$(shell nproc) && \ make install-gcc -j$(shell nproc) && \ make install-target-libgcc -j$(shell nproc)