-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
56 lines (39 loc) · 1.26 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# For FreshTomato builds, ignored in other cases
-include ../common.mak
OPENSSL_CFLAGS = -DOPENSSL -DURL_PROTOCOL='"https"'
OPENSSL_LIBS = -lssl -lcrypto
CFLAGS = -Os -Wall -std=c99 $(OPENSSL_CFLAGS) $(EXTRACFLAGS)
LDFLAGS =
LIBS := -lm -lpthread $(OPENSSL_LIBS)
ifdef TOMATO_BUILD
LIBS += -L$(TOP)/openssl
CFLAGS += -I $(TOP)/openssl/include
endif
OBJDIR = .
SRCDIR = src
SOURCES := $(wildcard $(SRCDIR)/*.c)
OBJS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
all: SpeedTestC
SpeedTestC: $(OBJS)
@echo " [SpeedTestC] CC $@"
@$(CC) -o $@ $(OBJS) $(LIBS)
$(SIZECHECK)
$(CPTMP)
install:
@echo " [SpeedTestC] Installing to $(INSTALLDIR)"
@install -D SpeedTestC $(INSTALLDIR)/usr/bin/SpeedTestC
@$(STRIP) $(INSTALLDIR)/usr/bin/SpeedTestC
@chmod 0500 $(INSTALLDIR)/usr/bin/SpeedTestC
clean:
rm -f SpeedTestC *.o .*.depend
size: SpeedTestC
mipsel-uclibc-nm --print-size --size-sort SpeedTestC
$(OBJS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@echo " [SpeedTestC] CC $@"
@$(CC) $(CFLAGS) -c $< -o $@
.%.depend: %.c
@$(CC) $(CFLAGS) -M $< > $@
-include $(OBJS:%.o=.%.depend)
test: SpeedTestC
valgrind --leak-check=full --show-leak-kinds=all ./SpeedTestC --server http://speedtest.skynet.net.pl/speedtest/upload.php
valgrind --leak-check=full --show-leak-kinds=all ./SpeedTestC