Restore makefile because it has better comptimes

This commit is contained in:
bumbread 2022-06-28 18:04:22 +11:00
parent 14c3e8b758
commit 0d58124c26
3 changed files with 48 additions and 5 deletions

20
Makefile Normal file
View File

@ -0,0 +1,20 @@
GNUFLAGS=-Werror -Wall -Iinc -Isrc/win
CLFLAGS=/I:inc /I:src/win /link /incremental:no /subsystem:windows /nodefaultlib kernel32.lib
CC=clang
CFLAGS=$(GNUFLAGS)
LDFLAGS=/nologo /nodefaultlib /entry:mainCRTStartup
SRC_DIR := src
OBJ_DIR := bin
SRC_FILES := $(wildcard $(SRC_DIR)/code/*.c) $(wildcard $(SRC_DIR)/win/*.c)
OBJ_FILES := $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.obj,$(SRC_FILES))
ciabatta.lib: $(OBJ_FILES)
lib $(LDFLAGS) /out:$@ $^
$(OBJ_DIR)/%.obj: $(SRC_DIR)/%.c
$(CC) $(CFLAGS) -c -o $@ $<
.PHONY: ciabatta.lib

View File

@ -101,11 +101,11 @@ void qsort(
); );
// Multibyte strings // Multibyte strings
// int mblen(const char *s, size_t n); int mblen (const char *s, size_t n);
// int mbtowc(wchar_t * restrict pwc, const char * restrict s, size_t n); int mbtowc (wchar_t *restrict pwc, const char *restrict s, size_t n);
// int wctomb(char *s, wchar_t wchar); size_t mbstowcs(wchar_t *restrict pwcs, const char *restrict s, size_t n);
// size_t mbstowcs(wchar_t * restrict pwcs, const char * restrict s, size_t n); int wctomb (char *s, wchar_t wchar);
// size_t wcstombs(char * restrict s, const wchar_t * restrict pwcs, size_t n); size_t wcstombs(char *restrict s, const wchar_t *restrict pwcs, size_t n);
// #ifdef __STDC_WANT_LIB_EXT1__ // #ifdef __STDC_WANT_LIB_EXT1__
// typedef void (*constraint_handler_t)(const char * restrict msg, void * restrict ptr, errno_t error); // typedef void (*constraint_handler_t)(const char * restrict msg, void * restrict ptr, errno_t error);

View File

@ -0,0 +1,23 @@
#include <stdlib.h>
int mblen(const char *s, size_t n) {
return mbtowc((wchar_t*)0, s, n);
}
int mbtowc(wchar_t *restrict pwc, const char *restrict s, size_t n) {
}
size_t mbstowcs(wchar_t *restrict pwcs, const char *restrict s, size_t n) {
}
int wctomb(char *s, wchar_t wchar) {
}
size_t wcstombs(char *restrict s, const wchar_t *restrict pwcs, size_t n) {
}