CC=gcc CFLAGS= LIB_FILE=libstack.so .PHONY: all all: $(LIB_FILE) $(LIB_FILE): stack.o $(CC) $(CFLAGS) -shared stack.o -o $(LIB_FILE) stack.o: stack.c $(CC) $(CFLAGS) -fpic -c stack.c -o stack.o .PHONY: allwarn allwarn: CFLAGS+=-Wall -Wextra -pedantic allwarn: $(LIB_FILE) .PHONY: debug debug: CFLAGS+=-g debug: $(LIB_FILE) .PHONY: clean clean: rm stack.o rm $(LIB_FILE)