File: Makefile

package info (click to toggle)
wireless-tools 23-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 356 kB
  • ctags: 924
  • sloc: ansic: 4,391; makefile: 82; sh: 69
file content (94 lines) | stat: -rw-r--r-- 2,241 bytes parent folder | download
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
#
# Basic and crude Makefile...
#

# Targets to build
STATIC=libiw.a
DYNAMIC=libiw.so.23
PROGS= iwconfig iwlist iwpriv iwspy iwgetid
MANPAGES=iwconfig.8 iwlist.8 iwpriv.8 iwspy.8

# Composition of the library :
OBJS = iwlib.o

# Define if tools should be built using static or dynamic version of the lib
IWLIBS=$(OBJS)
#IWLIBS=-liw

# Installation directory. By default, go in local.
# Distributions should probably use /usr/sbin, but they probably know better...
INSTALL_DIR= `pwd`/debian/tmp/sbin
INSTALL_LIB= `pwd`/debian/tmp/usr/lib
INSTALL_INC= `pwd`/debian/tmp/usr/include
INSTALL_MAN= `pwd`/debian/tmp/usr/share/man

# Header selection is now supposed to be automatic...

# Use private copy of Wireless Extension definition instead of the
# system wide one in /usr/include/linux. Use with care.
# Can be used to create multiple versions of the tools on the same system
# for multiple kernels or get around broken distributions.
#WE_HEADER= -DPRIVATE_WE_HEADER
WE_HEADER=

# ------------ End of config --------------

CC = gcc
RM = rm -f

RM_CMD = $(RM) *.BAK *.bak *.o ,* *~ *.a *.so.* $(PROGS)

CFLAGS=-O2 -Wall $(HEADERS) $(WE_HEADER)

LIBS=$(IWLIBS) -lm

all:: $(PROGS)

.c.o:
	$(CC) $(CFLAGS) -c $<

iwconfig: iwconfig.o $(OBJS)
	$(CC) $(CFLAGS) -o $@ $< $(LIBS)

iwlist: iwlist.o $(OBJS)
	$(CC) $(CFLAGS) -o $@ $< $(LIBS)

iwpriv: iwpriv.o $(OBJS)
	$(CC) $(CFLAGS) -o $@ $< $(LIBS)

iwspy: iwspy.o $(OBJS)
	$(CC) $(CFLAGS) -o $@ $< $(LIBS)

iwgetid: iwgetid.o
	$(CC) $(CFLAGS) -o $@ $^

# Compilation of the dynamic library
$(DYNAMIC): $(OBJS)
	$(CC) -O2 -shared -o $@ -Wl,-soname,$@ -lm -lc $^

# Compilation of the static library
$(STATIC): $(OBJS)
	$(RM) $@
	ar cru $@ $^
	ranlib $@

# So crude but so effective ;-)
# Less crude thanks to many contributions ;-)
install::
	install -m 755 $(PROGS) $(INSTALL_DIR)/
#	install -m 644 $(STATIC) $(INSTALL_LIB)/
#	install -m 755 $(DYNAMIC) $(INSTALL_LIB)/
#	echo "Don't forget to fix your /etc/ld.so.conf and run ldconfig."
#	install -m 644 iwlib.h $(INSTALL_INC)/
	install -m 644 $(MANPAGES) $(INSTALL_MAN)/man8/

clean::
	$(RM_CMD) 

realclean::
	$(RM_CMD) 
	$(RM) $(STATIC) $(DYNAMIC) $(PROGS)

depend::
	makedepend -s "# DO NOT DELETE" -- $(INCLUDES) -- $(SRCS)
# DO NOT DELETE