summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7e8a5695344ad5cfbd7e2003fe550f0323d0e7c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
CC=gcc
AR=ar
CFLAGS=-Wall -Wextra -std=c11 -O2 -Iinclude -Iinclude/tinyff -Iinclude/ext

SRC=$(shell find src -name "*.c")
OBJ=$(SRC:.c=.o)

LIB=libtinyff.a
OUTDIR=dist

all: $(LIB)

$(OUTDIR):
	mkdir -p $(OUTDIR)

$(LIB): $(OBJ)
	$(AR) rcs $(OUTDIR)/$(LIB) $(OUTDIR)/$(OBJ)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $(OUTDIR)/$@

clean:
	rm -f $(OUTDIR)/$(OBJ) $(LIB)

.PHONY: all clean