forked from kabavol/LMSMonitor
-
Notifications
You must be signed in to change notification settings - Fork 2
/
make_sse
52 lines (36 loc) · 1.4 KB
/
make_sse
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
TARGET = ./bin/lmsmonitor-sse
# need https support so ssl and crypto added
LIBS = -pthread -lrt -L./lib -li2c -lssl -lcrypto
CC = g++
CFLAGS = -g -Wall -std=c11 -Ofast -fPIC -fno-rtti -Wno-unused-variable \
-Wno-unused-parameter -Wstringop-truncation -mfpu=vfp -mfloat-abi=hard \
-fpermissive -Wunused-function -Wstringop-truncation -Wunused-but-set-variable -Wstringop-overflow \
-funsafe-math-optimizations -ffast-math -pipe -I. -I./src
bin:
mkdir bin
.PHONY: default all clean
default: $(TARGET)
all: cleansse coresse ./sse/digest-sse.c coresse $(TARGET)
SSE = -I./src -I./sse
OBJECTS = $(patsubst %.cpp, %.o, $(wildcard ./src/*.cpp)) $(patsubst %.cc, %.o, $(wildcard ./src/*.cc)) $(patsubst %.c, %.o, $(wildcard ./src/*.c))
OBJECTSCC = $(OBJECTS) $(patsubst %.cc, %.o, $(wildcard ./sse/*.cc)) $(patsubst %.c, %.o, $(wildcard ./sse/*.c))
HEADERS = $(wildcard ./src/*.h) $(wildcard ./font/*.h) $(wildcard ./sse/*.h)
%.o: %cc $(HEADERSCC)
$(CC) $(SSE) $(CFLAGS) -c $< -o $@
sse/digest-sse.c: ./sse/digest-sse.flex
flex -I -o $@ $<
std:
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
.PRECIOUS: $(TARGET) $(OBJECTS) $(OBJECTSCC) coresse
coresse:
%.o: %cc %c $(HEADERS)
$(CC) $(SSE) $(CFLAGS) -c $< -o $@
$(TARGET): coresse $(HEADERS) $(OBJECTSCC)
$(CC) $(SSE) $(OBJECTSCC) -g -Wall $(LIBS) -o $@
cleansse:
-rm -f sse/digest-sse.c
-rm -f src/*.o
-rm -f sse/*.o
-rm -f *.o
-rm -f $(TARGET)