You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
381 B
Makefile

2 years ago
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)