summaryrefslogtreecommitdiff
path: root/src/Makefile
blob: 1b64deac996bd79d354cee93bd1edef68b8b52cd (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
#	IRBOX, an Ivy driver for infra-red remote controls
#
#	Copyright 1998-1999 
#	Centre d'Etudes de la Navigation Aerienne
#
#	Makefile
#
#	Authors: Stephane Chatty <chatty@cena.dgac.fr>
#
#	$Id$
#
#	Please refer to file version.h for the
#	copyright notice regarding this software
#

SHELL = /bin/sh
CC = gcc
IRBOX_DIR = /usr/lib/irbox

SRCS = irdev.c irtable.c irbox.c 
OBJS =  irdev.o irtable.o lex.yy.o y.tab.o irbox.o

CDEFS = -DDEFAULT_IRBOX_DIR=\"$(IRBOX_DIR)\"
COPTS =  -g -Wall
CINCS = -I../../../libraries/ivy-c/src
CLIBS = -I../../../libraries/ivy-c/src
CFLAGS = $(CDEBUGFLAGS) $(CDEFS) $(COPTS) $(CINCS)
LDFLAGS = $(COPTS) $(CLIBS)

all:	irbox

irbox:	$(OBJS)
	$(CC) $(LDFLAGS) -o irbox $(OBJS) -livy 

irdev.o: irdev.h

irbox.o: irdev.h

y.tab.h y.tab.c: gram.y
	yacc -d gram.y

lex.yy.c: gram.l
	lex gram.l

lex.yy.o: lex.yy.c y.tab.h

clean:
	-/bin/rm -f *.a *.o *.out *.bak *.yy.* *.tab.* *.log irbox

install: all
	test -d $(PREFIX)/usr/bin || mkdirhier $(PREFIX)/usr/bin
	install -m755 irbox $(PREFIX)/usr/bin
	test -d $(PREFIX)/usr/man/man5 || mkdirhier $(PREFIX)/usr/man/man5
	install -m 644 ../doc/irbox.5 $(PREFIX)/usr/man/man5
	test -d $(PREFIX)/usr/man/man8 || mkdirhier $(PREFIX)/usr/man/man8
	install -m 644 ../doc/irbox.8 $(PREFIX)/usr/man/man8
	test -d $(PREFIX)$(IRBOX_DIR) || mkdirhier $(PREFIX)$(IRBOX_DIR)
	for f in `find ../data -type f -maxdepth 1`; do \
		install -m 644 $$f $(PREFIX)$(IRBOX_DIR); \
	done


rpm::
	/usr/bin/rpmize