-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
39 lines (27 loc) · 893 Bytes
/
Makefile
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
37
38
# Makefile for hev-tls-tunnel
PP=cpp
CC=cc
CONFIG=-DUSE_SSE
CCFLAGS=-O3 -Werror -Wall $(CONFIG) `pkg-config --cflags gio-2.0`
LDFLAGS=`pkg-config --libs gio-2.0`
SRCDIR=src
BINDIR=bin
BUILDDIR=build
TARGET=$(BINDIR)/hev-tls-tunnel
CCOBJSFILE=$(BUILDDIR)/ccobjs
-include $(CCOBJSFILE)
LDOBJS=$(patsubst $(SRCDIR)%.c,$(BUILDDIR)%.o,$(CCOBJS))
DEPEND=$(LDOBJS:.o=.dep)
all : $(CCOBJSFILE) $(TARGET)
@$(RM) $(CCOBJSFILE)
clean :
@echo -n "Clean ... " && $(RM) $(BINDIR)/* $(BUILDDIR)/* && echo "OK"
$(CCOBJSFILE) :
@echo CCOBJS=`ls $(SRCDIR)/*.c` > $(CCOBJSFILE)
$(TARGET) : $(LDOBJS)
@echo -n "Linking $^ to $@ ... " && $(CC) -o $@ $^ $(LDFLAGS) && echo "OK"
$(BUILDDIR)/%.dep : $(SRCDIR)/%.c
@$(PP) $(CCFLAGS) -MM -MT $(@:.dep=.o) -o $@ $<
$(BUILDDIR)/%.o : $(SRCDIR)/%.c
@echo -n "Building $< ... " && $(CC) $(CCFLAGS) -c -o $@ $< && echo "OK"
-include $(DEPEND)