switch to clang compiler

This commit is contained in:
2025-01-12 20:33:57 +01:00
parent 264648601a
commit c53ff4692e

View File

@@ -14,9 +14,9 @@ clean:
# sets the variables for the different targets # sets the variables for the different targets
linux-x86_64: linux-x86_64:
$(MAKE) build ARCH=linux-x86_64 CC=gcc PCFLAGS="-lSDL2" $(MAKE) build ARCH=linux-x86_64 CC=clang PCFLAGS="-target x86_64-pc-linux-gnu -lSDL2"
win-x86_64: win-x86_64:
$(MAKE) build ARCH=win-x86-64 CC=x86_64-w64-mingw32-gcc PCFLAGS="-lmingw32 -lSDL2main -lSDL2 -mwindows" EXT=".exe" $(MAKE) build ARCH=win-x86-64 CC=clang PCFLAGS="-target x86_64-pc-windows-gnu -lmingw32 -lSDL2main -lSDL2 -mwindows" EXT=".exe"
web: web:
$(MAKE) build ARCH=web CC=emcc PCFLAGS="-s USE_SDL=2" EXT=".html" $(MAKE) build ARCH=web CC=emcc PCFLAGS="-s USE_SDL=2" EXT=".html"
@@ -26,10 +26,10 @@ build: dirs binary
binary: $(OBJ) binary: $(OBJ)
$(CC) -o $(TARGET) $^ $(CFLAGS) $(PCFLAGS) $(CC) -o $(TARGET) $^ $(CFLAGS) $(PCFLAGS)
# creates the object files # creates the object files, include a flag for no unused command line arguments, because in this context it's unneeded
$(DIR_OBJ)/$(ARCH)/%.o: src/%.c $(DIR_OBJ)/$(ARCH)/%.o: src/%.c
mkdir -p $(dir $@) mkdir -p $(dir $@)
$(CC) -o $@ -c $< $(CFLAGS) $(PCFLAGS) $(CC) -o $@ -c $< $(CFLAGS) $(PCFLAGS) -Wno-unused-command-line-argument
dirs: dirs:
mkdir -p $(DIR_BIN)/$(ARCH) mkdir -p $(DIR_BIN)/$(ARCH)