I am making a simple lib to use in my apps to save me the trouble of defining some functions over and over...
Here's my makefile:
CC=gcc
CFLAGS=-Wall -g -Wextra
OBJS=getline.o debug.o
LIB=libjimi.a
.PHONY: clean purge
libjimi.so : $(OBJS)
ar rcs $(LIB) $(OBJS)
@echo done!
%.o : %.c
$(CC) $(CFLAGS) -c $^
clean :
@rm *.o
purge : clean
@rm $(LIB)
Now I get a segfault if I link the library, but if I link the object files that I link to create the library, it works...advice?