summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: b55dec58e98507e48a07fef7660581066af4227e (plain)
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
CFLAGS=-Wall ${CURSES_CFLAGS}
PKG_CONFIG=pkg-config
CURSES_CFLAGS=$(shell ${PKG_CONNFIG} --cflags ncursesw)
CURSES_LIBS=$(shell ${PKG_CONFIG} --libs ncursesw)

#OPENWRT_BASE=/root/projects/openwrt/gl-inet-mt300n-v2/master-d20f4fc
#TOOLCHAIN=${OPENWRT_BASE}/staging_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl
#CC=${TOOLCHAIN}/bin/mipsel-openwrt-linux-musl-gcc
#STAGING_DIR=${OPENWRT_BASE}/staging_dir/target-mipsel_24kc_musl
#export STAGING_DIR
#CFLAGS=-I${STAGING_DIR}/include -I${TOOLS_DIR}/include

PROGS=net_rx net_arm serial_rx serial_arm serial_keypad net_keypad #test_email

PREFIX=/usr/local

all: ${PROGS}

install: ${PROGS}
	mkdir -p ${DESTDIR}/${PREFIX}/bin
	for i in ${PROGS}; do install -m 755 $$i ${DESTDIR}/${PREFIX}/bin/$$i; done

net_rx:util.o sia.o net_rx.o rx.o email.o
net_arm:util.o sia.o net_arm.o arm.o 
serial_rx:util.o sia.o serial_rx.o rx.o email.o
serial_arm:util.o sia.o serial_arm.o arm.o
test_email:test_email.o email.o

serial_keypad:util.o keypad.o serial_keypad.o
	${CC} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${CURSES_LIBS} ${LIBS}

net_keypad:util.o keypad.o net_keypad.o
	${CC} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${CURSES_LIBS} ${LIBS}

tidy:
	astyle -A3 -s2 --attach-extern-c -L -c -w -Y -m0 -f -p  -H -U -k3 -xj -xd sia.c sia.h util.c util.h serial_rx.c net_rx.c serial_arm.c net_arm.c arm.c keypad.c net_keypad.c serial_keypad.c rx.c email.c test_email.c

clean:
	/bin/rm -f *.o