use static library instead of object

This commit is contained in:
grimhilt
2023-11-13 13:06:47 +01:00
parent c7d011b301
commit 60c6c6b8c4
5 changed files with 33 additions and 12 deletions

View File

@@ -1,21 +1,24 @@
CC = gcc
CFLAGS := -std=c99 -Wall -Wextra -Werror -pedantic -Wvla
OBJ_RUN := src/student.c src/main.o src/pin_handler.o
OBJ_RUN := src/student.c
all: run
%.o: %.c
@$(CC) $(LFLAGS) $(CFLAGS) -c -o $@ $<
prepare: CFLAGS += -shared
prepare: src/main.o src/pin_handler.o
ar crs src/pin_handler.a $^
tar czf student.tar.gz src/pin_handler.a src/student.c src/default_student.c Makefile student.ino src/parser.c
parser: src/parser.o student.ino
@$(CC) $(CFLAGS) -o $@ src/parser.o
@./parser ./student.ino
run: parser $(OBJ_RUN) student.ino
@$(CC) -o main $(OBJ_RUN)
@$(CC) -o main $(OBJ_RUN) src/pin_handler.a
@./main
%.o: %.c
@$(CC) $(LFLAGS) $(CFLAGS) -c -o $@ $<
clean:
$(RM) src/*.o main parser