diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..da34213 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bmp2rgb565 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2df37d0 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +CC=gcc +CC_FLAGS=-c -Wall -Werror -std=gnu99 -g +CC_LIBS= +INCLUDES= + +SOURCES=main.c +OBJECTS=$(SOURCES:.c=.o) +OUTPUT=bmp2rgb565 + +all: $(SOURCES) $(OUTPUT) + +$(OUTPUT): $(OBJECTS) + $(CC) $(OBJECTS) $(CC_LIBS) -o $@ + +%.o: %.c + $(CC) $(INCLUDES) $(CC_FLAGS) $< -o $@ + +clear: + rm -f $(OUTPUT) $(OBJECTS) diff --git a/main.c b/main.c new file mode 100644 index 0000000..140c500 --- /dev/null +++ b/main.c @@ -0,0 +1,31 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + if(argc != 3) + { + printf("bmp2rgb565 [BMP_SRC] [RGB565_DEST]\n"); + return 1; + } + + FILE* src = NULL; + FILE* dst = NULL; + + src = fopen(argv[1], "r"); + dst = fopen(argv[2], "w"); + + if(src == NULL) + { + printf("Unable to open the BMP file\n"); + return 2; + } + + if(dst == NULL) + { + printf("Unable to open the RGB565 file\n"); + return 3; + } + + return 0; +} -- libgit2 0.21.2