-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (29 loc) · 753 Bytes
/
Makefile
File metadata and controls
36 lines (29 loc) · 753 Bytes
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
31
32
33
34
35
36
ifeq ($(OS),Windows_NT)
detected_OS := Windows
else
detected_OS := $(shell uname -s)
endif
CC=gcc
SRCS=main.c client.c path.c settings.c network.c ddp.c pcap.c log.c queue.c http.c rmq_api.c urlencode.c
OBJS=$(subst .c,.o,$(SRCS))
EXE=appletalk-bridge
CFLAGS=-DDEBUG=0
LDFLAGS=
JSON_CFLAGS=
LIBS=-lrabbitmq -lpcap -lpthread -luuid -lcurl -ljson-c
ifeq ($(detected_OS),Darwin)
JSON_CFLAGS=$(shell pkg-config --cflags json-c)
LDFLAGS=$(shell pkg-config --libs-only-L json-c)
endif
all: $(EXE)
clean:
rm -f $(OBJS) $(EXE)
$(EXE): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
settings.c: uthash
uthash:
git clone https://github.com/troydhanson/uthash.git
%.o: %.c
$(CC) $(CFLAGS) -c $<
rmq_api.o: rmq_api.c
$(CC) $(CFLAGS) $(JSON_CFLAGS) -c $<