forked from peterkvt80/vbit2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (29 loc) · 1.43 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
#Set the compiler for C++11 ("gcc" for C or "g++" for C++)
CC=g++
#Set any compiler flags you want to use (e.g. "-I."), or leave blank
CXXFLAGS = -g -O2 -Wall -std=gnu++11 -fstack-protector-all -Wextra -I.
LIBS = -lpthread -fstack-protector
ifeq ($(OS),Windows_NT)
CXXFLAGS += -DWIN32
LIBS += -lwsock32
else
ifeq ($(shell test -e /etc/os-release && echo -n yes),yes)
ifeq ($(shell if [ `grep -c raspbian /etc/os-release` -gt 0 ]; then echo true ; else echo false ; fi), true)
CXXFLAGS += -DRASPBIAN
endif
endif
endif
#Set any dependent files (e.g. header files) so that if they are edited they cause a re-compile (e.g. "main.h my_sub_functions.h some_definitions_file.h"), or leave blank
DEPS = vbit2.h service.h configure.h pagelist.h ttxpage.h packet.h tables.h ttxpagestream.h ttxline.h carousel.h filemonitor.h command.h TCPClient.h newfor.h hamm-tables.h packetsource.h packetmag.h packet830.h packetsubtitle.h ttxcodes.h specialpages.h normalpages.h
OBJ = vbit2.o service.o configure.o pagelist.o ttxpage.o packet.o tables.o ttxpagestream.o ttxline.o carousel.o filemonitor.o command.o TCPClient.o newfor.o packetsource.o packetmag.o packet830.o packetsubtitle.o specialpages.o normalpages.o
#Below here doesn't need to change
#Compile each object file
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
#Combine them into the output file
vbit2: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
#Cleanup
.PHONY: clean
clean:
rm -f *.o *~ core *~