2022-02-04 15:48:21 +03:00
|
|
|
CFLAGS := -Wall -Wextra -Werror -pedantic -std=c99 -Wno-attributes
|
2022-01-30 23:04:56 +03:00
|
|
|
CLIBS := -lm
|
|
|
|
INCLUDES := -Isrc
|
2022-01-31 14:40:06 +03:00
|
|
|
OBJECTS := obj/stb_image.o obj/stb_image_resize.o \
|
2022-02-03 14:19:39 +03:00
|
|
|
obj/colors.o obj/args.o obj/image.o obj/commons.o \
|
2022-02-03 15:41:54 +03:00
|
|
|
obj/mod_blocks.o obj/mod_braille.o
|
2022-02-03 23:46:56 +03:00
|
|
|
VERSION := "v-git-$(shell git rev-parse --short HEAD)"
|
2022-01-30 23:04:56 +03:00
|
|
|
|
2022-02-03 23:46:56 +03:00
|
|
|
all: lib yaitaa
|
2022-01-30 23:04:56 +03:00
|
|
|
|
|
|
|
lib: $(OBJECTS)
|
|
|
|
|
|
|
|
clean:
|
2022-02-03 23:46:56 +03:00
|
|
|
$(RM) yaitaa obj/*
|
2022-01-30 23:04:56 +03:00
|
|
|
|
2022-02-07 12:25:03 +03:00
|
|
|
install:
|
|
|
|
install -D -m 755 yaitaa $(INSTALL_PATH)/yaitaa
|
|
|
|
|
2022-02-03 23:46:56 +03:00
|
|
|
yaitaa: lib
|
|
|
|
$(CC) $(CFLAGS) src/main.c $(INCLUDES) $(OBJECTS) $(CLIBS) -o ./yaitaa
|
2022-01-30 23:04:56 +03:00
|
|
|
|
|
|
|
obj/%.o: src/%.c
|
2022-02-03 23:46:56 +03:00
|
|
|
$(CC) $(CFLAGS) $^ $(INCLUDES) -DVERSION="\"$(VERSION)\"" -c -o $@
|
2022-01-30 23:04:56 +03:00
|
|
|
|
2022-02-04 21:51:12 +03:00
|
|
|
testbuild: use_clang use_tcc
|
2022-02-04 18:08:53 +03:00
|
|
|
make clean all
|
|
|
|
oclint src/*.c
|
2022-02-04 21:51:12 +03:00
|
|
|
|
|
|
|
use_clang:
|
|
|
|
make clean all CC=clang
|
|
|
|
|
|
|
|
use_tcc:
|
|
|
|
make clean all CC=tcc CFLAGS="$(CFLAGS) -DSTBI_NO_SIMD"
|