Added Makefile

master
Aadhavan Srinivasan 2 years ago
parent 2f3431d036
commit d152c11365

@ -0,0 +1,26 @@
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)
Loading…
Cancel
Save