File: Makefile.in

package info (click to toggle)
faifa 0.2~svn82-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 304 kB
  • ctags: 844
  • sloc: ansic: 3,523; sh: 169; makefile: 90
file content (114 lines) | stat: -rw-r--r-- 2,448 bytes parent folder | download | duplicates (2)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#
# Makefile for the faifa program and library
#
#
# Copyright (C) 2007-2009
#	Xavier Carcelle <xavier.carcelle@gmail.com>
#	Florian Fainelli <florian@openwrt.org>
#	Nicolas Thill <nico@openwrt.org>
#
# License:
#	GPLv2
#

CC	= @CC@
STRIP	?= $(CROSS)strip
CFLAGS	= @CFLAGS@ -Wno-unused-result
INSTALL	= @INSTALL@
LIBS	= @LIBS@

prefix		= @prefix@
exec_prefix	= @exec_prefix@
bindir		= @bindir@
mandir		= @mandir@
libdir		= @libdir@
datarootdir	= @datarootdir@
includedir	= @includedir@

OS?=$(shell uname -s | tr a-z A-Z)
APP:=faifa
SVN_REV?=$(shell LC_ALL=C svn info | awk '/Revision/ { print $$2 }')

# Object files for the library
LIB_OBJS:=faifa.o frame.o crypto.o
LIB_NAME:=lib$(APP).a
LIB_SONAME:=lib$(APP).so.0

# Object files for the program
OBJS:= main.o
HEADERS:= faifa.h faifa_compat.h faifa_priv.h homeplug.h homeplug_av.h crypto.h device.h endian.h

ifeq ($(OS),DARWIN)
LDFLAGS:=-dynamiclib -Wl,-dylib_install_name -Wl,$(LIB_SONAME)
endif

LIBS:=$(LDFLAGS) $(LIBS)

ifeq ($(OS),CYGWIN_NT-5.1)
LIBS+=-lwpcap
APP:=$(APP).exe
else
CFLAGS+= -fPIC
endif

man8dir = $(mandir)/man8
# Man page
MANTYP=8
MANFIL=$(APP).8.gz

all: $(APP) $(LIB_NAME) $(LIB_SONAME)

$(APP): $(OBJS) $(HEADERS) $(LIB_SONAME)
	$(CC) -D$(OS) -DSVN_REV=$(SVN_REV) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(LIB_SONAME)

$(LIB_NAME): $(LIB_OBJS) $(HEADERS)
	$(AR) rcs $(LIB_NAME)	$(LIB_OBJS)

$(LIB_SONAME): $(LIB_OBJS) $(HEADERS)
	$(CC) -shared -Wl,-soname,$(LIB_SONAME) -o $(LIB_SONAME) $(LIB_OBJS) $(LIBS)

%.o: %.c $(HEADERS)
	$(CC) -D$(OS) -DSVN_REV=$(SVN_REV) $(CFLAGS) -c $<

clean:
	rm -f $(APP) faifa-dump-devel-stdout \
		*.o \
		*.a \
		*.so* \
		$(MANFIL)

autoclean:
	-rm -f configure config.log config.status Makefile

distclean: clean autoclean

install: installman strip
	$(INSTALL) -d $(DESTDIR)$(bindir)
	$(INSTALL) -m0755 $(APP) $(DESTDIR)$(bindir)
	$(INSTALL) -d $(DESTDIR)$(libdir)
	$(INSTALL) -m0644 $(LIB_SONAME) $(DESTDIR)$(libdir)
	$(INSTALL) -d $(DESTDIR)$(includedir)/faifa
	cp $(HEADERS) $(DESTDIR)$(includedir)/faifa

strip:
	$(STRIP) $(APP)
	$(STRIP) $(LIB_SONAME)

man:
	-rm -f $(MANFIL)
	gzip -c -q -9v $(APP).$(MANTYP) > $(MANFIL)

installman: man
	$(INSTALL) -d $(DESTDIR)$(man8dir)
	$(INSTALL) -m0644 $(MANFIL) $(DESTDIR)$(man8dir)

uninstallman:
	-rm -f $(DESTDIR)$(man8dir)/$(MANFIL)

uninstall: uninstallman
	-rm -f $(DESTDIR)$(bindir)/$(APP)
	-rm -f $(DESTDIR)$(libdir)/$(LIB_SONAME)
	-rm -rf $(DESTDIR)$(includedir)/faifa

.PHONY:
	clean