Skip to content

Commit 95c2d27

Browse files
committed
Fix clean target on Windows, add default all target, add info about lld on linux to readme
1 parent 124249d commit 95c2d27

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ C_SRCS := $(wildcard src/*.c)
2828
C_OBJS := $(addprefix $(BUILD_DIR)/, $(C_SRCS:.c=.o))
2929
C_DEPS := $(addprefix $(BUILD_DIR)/, $(C_SRCS:.c=.d))
3030

31+
all: $(TARGET)
32+
3133
$(TARGET): $(C_OBJS) $(LDSCRIPT) | $(BUILD_DIR)
3234
$(LD) $(C_OBJS) $(LDFLAGS) -o $@
3335

@@ -42,8 +44,12 @@ $(C_OBJS): $(BUILD_DIR)/%.o : %.c | $(BUILD_DIR) $(BUILD_DIR)/src
4244
$(CC) $(CFLAGS) $(CPPFLAGS) $< -MMD -MF $(@:.o=.d) -c -o $@
4345

4446
clean:
47+
ifeq ($(OS),Windows_NT)
48+
rmdir /S /Q $(BUILD_DIR)
49+
else
4550
rm -rf $(BUILD_DIR)
51+
endif
4652

4753
-include $(C_DEPS)
4854

49-
.PHONY: clean
55+
.PHONY: clean all

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ See [this document](https://hackmd.io/fMDiGEJ9TBSjomuZZOgzNg) for an explanation
1111
You'll need to install `clang` and `make` to build this template.
1212
* On Windows, using [chocolatey](https://chocolatey.org/) to install both is recommended. The packages are `llvm` and `make` respectively.
1313
* The LLVM 19.1.0 [llvm-project](https://github.com/llvm/llvm-project) release binary, which is also what chocolatey provides, does not support MIPS correctly. The solution is to install 18.1.8 instead, which can be done in chocolatey by specifying `--version 18.1.8` or by downloading the 18.1.8 release directly.
14-
* On Linux, these can both be installed using your distro's package manager.
14+
* On Linux, these can both be installed using your distro's package manager. You may also need to install your distro's package for the `lld` linker. On Debian/Ubuntu based distros this will be the `lld` package.
1515
* On MacOS, these can both be installed using Homebrew. Apple clang won't work, as you need a mips target for building the mod code.
1616

1717
On Linux and MacOS, you'll need to also ensure that you have the `zip` utility installed.

0 commit comments

Comments
 (0)