]> rtime.felk.cvut.cz Git - coffee/mt-apps.git/blob - Makefile
Makefile: Remove all autodetection
[coffee/mt-apps.git] / Makefile
1 OUTPUT_DIR    = build
2
3 ifeq ($(SIM),)
4 # Compile for terminal
5 all: mtrfid mtserver mtkeys mtaio
6 else
7 # Compile just simulator
8 all: mtaio
9 endif
10
11 mtrfid_SRCS   = signal_exit.c mt_rfid.c
12 mtrfid_LIBS   = -lev -luFCoder-armhf
13 mtrfid_DEFS   = -DHAVE_RFID=1
14
15 mtserver_SRCS = signal_exit.c mt_server.c
16 mtserver_LIBS = -lev -lwebsockets
17
18 mtkeys_SRCS   = signal_exit.c mt_keys.c
19 mtkeys_LIBS   = -lev
20
21 mtaio_SRCS    = signal_exit.c mt_keys.c mt_server.c mt_aio.c mt_blank.c
22 mtaio_LIBS    = -lev -lwebsockets
23 mtaio_DEFS    = -DNO_MAIN -DHAVE_RFID=$(if $(HAVE_RFID),1,0)
24
25 ifeq ($(SIM),)
26 mtaio_SRCS += mt_rfid.c
27 mtaio_LIBS += -luFCoder-armhf
28 else
29 mtaio_SRCS += mt_sim.c
30 mtaio_DEFS += -DSIM=1 -Ilibwebsockets/include -Llibwebsockets/lib -g -lz $(shell pkg-config --libs openssl)
31
32 libwebsockets/CMakeLists.txt:
33         git submodupe update --init libwebsockets
34
35 libwebsockets/CMakeCache.txt: libwebsockets/CMakeLists.txt
36         cd libwebsockets && cmake -DLWS_WITH_LIBEV=ON -DLWS_WITH_SHARED=OFF .
37
38 libwebsockets/lib/libwebsockets.a: libwebsockets/CMakeCache.txt
39         cd libwebsockets && cmake --build .
40
41 mt_server.c: libwebsockets/lib/libwebsockets.a
42 endif
43
44 .PHONY: clean
45
46 clean:
47         rm -rf $(OUTPUT_DIR)
48
49 .SECONDEXPANSION:
50 mtserver mtkeys mtaio mtrfid: $$($$@_SRCS)
51         mkdir -p $(OUTPUT_DIR)
52         $(CC) $(CFLAGS) $($@_DEFS) -o $(OUTPUT_DIR)/$@ $^ $($@_LIBS)