From 08bbb65dea3f73379ab21e5022299a07b947a694 Mon Sep 17 00:00:00 2001 From: ManojTGN Date: Sat, 8 Apr 2023 10:14:50 +0530 Subject: [PATCH] update makefile --- .gitignore | 1 - makefile | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 makefile diff --git a/.gitignore b/.gitignore index ac72779..c3fbf4a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ test/ build/ .vscode/ -makefile cmakelists.txt diff --git a/makefile b/makefile new file mode 100644 index 0000000..a27aabd --- /dev/null +++ b/makefile @@ -0,0 +1,35 @@ + +CC = gcc +CFLAGS = -lgdi32 -lfreetype +BINS = grafix.so grafix.a clean + +all: $(BINS) + +grafix.so: src/grafix.c src/shapes.c src/event.c src/time.c src/image.c src/font.c + $(CC) $(CFLAGS) -fPIC -shared -o build/grafix.so src/grafix.c src/shapes.c src/event.c src/time.c src/image.c src/font.c $(CFLAGS) $(CINCLUDES) + + +grafix.a: grafix.o shapes.o event.o time.o image.o font.o + ar rcs build/libgrafix.a build/grafix.o build/shapes.o build/event.o build/time.o build/image.o build/font.o + +grafix.o: src/grafix.c + $(CC) -c src/grafix.c -o build/grafix.o $(CFLAGS) + +shapes.o: src/shapes.c + $(CC) -c src/shapes.c -o build/shapes.o $(CFLAGS) + +event.o: src/event.c + $(CC) -c src/event.c -o build/event.o $(CFLAGS) + +time.o: src/time.c + $(CC) -c src/time.c -o build/time.o $(CFLAGS) + +image.o: src/image.c + $(CC) -c src/image.c -o build/image.o $(CFLAGS) + +font.o: src/font.c + $(CC) -c src/font.c -o build/font.o $(CFLAGS) + + +clean: + rm build/*.o $(BINS)