summaryrefslogtreecommitdiff
path: root/makefile
blob: 674f7040e7aeec272541375c2548bf1370cb0953 (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
26
27
28
29
30
bin:=$(notdir $(shell pwd))
src:=$(shell ls *.c)
obj:=$(src:.c=.o)

obj+=\
	toolbox/buffer.o \
	toolbox/http_parser.o \
	toolbox/io_muxer.o \
	toolbox/mqtt.o \
	toolbox/mqtt_parser.o \
	toolbox/utils.o

libs:=\
	luajit

CFLAGS+=$(shell pkg-config --cflags $(libs))
LDFLAGS+=$(shell pkg-config --libs $(libs))

all: $(bin)

$(bin): $(obj)
	$(CC) $^ $(LDFLAGS) -o $@

%.o: %.c *.h
	$(CC) -c $< $(CFLAGS) -o $@

clean:
	-rm $(bin) $(obj)

.PHONY: all clean