mirror of
https://github.com/olikraus/u8g2.git
synced 2025-10-14 02:43:40 +08:00
minor QoL improvements to bdfconv build
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
*.o
|
||||
*.~
|
||||
*.s
|
||||
*.~
|
||||
|
1
tools/font/bdfconv/.gitignore
vendored
Normal file
1
tools/font/bdfconv/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
bdfconv
|
@@ -1,9 +1,17 @@
|
||||
# works within ubuntu and min-gw (win7) environment
|
||||
# win7 exe uploaded on google drive
|
||||
|
||||
# requires gcc, eg. on Ubuntu "sudo apt install build-essential"
|
||||
CC = gcc
|
||||
CFLAGS = -g -Wall
|
||||
#CFLAGS = -O4 -Wall
|
||||
CFLAGS = -O4 -Wall -Werror
|
||||
|
||||
# for debugging ("make clean" after switching)
|
||||
#CFLAGS = -g -Wall -Werror
|
||||
|
||||
# more portable statically linked linux binary ("make clean" after switching)
|
||||
# requires musl-gcc, eg. on Ubuntu "sudo apt install musl-dev"
|
||||
#CC = x86_64-linux-musl-gcc
|
||||
#LDFLAGS = -static
|
||||
|
||||
SRC = main.c bdf_font.c bdf_glyph.c bdf_parser.c bdf_map.c bdf_rle.c bdf_tga.c fd.c bdf_8x8.c bdf_kern.c
|
||||
|
||||
@@ -13,11 +21,13 @@ ASM = $(SRC:.c=.s)
|
||||
.c.s:
|
||||
$(CC) $(CFLAGS) -S -o $@ $<
|
||||
|
||||
bdfconv: $(OBJ) $(ASM)
|
||||
bdfconv: $(OBJ)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) -o bdfconv
|
||||
|
||||
asm: $(ASM)
|
||||
|
||||
clean:
|
||||
-rm $(OBJ) $(ASM) bdfconv
|
||||
$(RM) *.o *.s bdfconv
|
||||
|
||||
test: bdfconv
|
||||
./bdfconv
|
||||
|
@@ -313,7 +313,10 @@ int bf_MapFile(bf_t *bf, const char *map_file_name)
|
||||
s = malloc(buf.st_size+1);
|
||||
if ( s == NULL )
|
||||
return 0;
|
||||
fread(s, buf.st_size, 1, fp);
|
||||
if ( fread(s, buf.st_size, 1, fp) != 1 ) {
|
||||
free(s);
|
||||
return 0;
|
||||
}
|
||||
s[buf.st_size] = '\0';
|
||||
fclose(fp);
|
||||
bf_Map(bf, s);
|
||||
|
Reference in New Issue
Block a user