File: Makefile.in

package info (click to toggle)
modutils 2.3.11-13.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,156 kB
  • ctags: 1,038
  • sloc: ansic: 10,567; sh: 2,120; lex: 484; makefile: 479; yacc: 362
file content (118 lines) | stat: -rw-r--r-- 3,113 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# $Id: Makefile.in 1.18 Tue, 18 Apr 2000 13:38:59 +1000 kaos $

srcdir=@srcdir@
VPATH=@srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
sbindir=@sbindir@
mandir=@mandir@
insmod_static=@insmod_static@

ARCH		= @ARCH@
CC		= @CC@
CFLAGS		= @CFLAGS@
LDFLAGS		= @LDFLAGS@
HOSTCC		= @HOSTCC@
HOSTCFLAGS	= @HOSTCFLAGS@
AR		= @AR@
RANLIB		= @RANLIB@
INSTALL		= @INSTALL_LOCAL@
STRIP		= @STRIP@

DEFSNOARCH	:= -I$(srcdir)/../include -D_GNU_SOURCE @DEFS@ $(EXTRA_DEFS)
DEFS		:= -DELF_MACHINE_H='"elf_$(ARCH).h"' -DARCH_$(ARCH)

PROGS		:= insmod modprobe rmmod lsmod ksyms kallsyms modinfo

# COMB is the list of utilities to combine with insmod into one executable
COMB		:= @COMBINE_rmmod@ @COMBINE_modprobe@ @COMBINE_lsmod@ @COMBINE_ksyms@ @COMBINE_kallsyms@
COMBDEFS	:= $(addprefix -DCOMBINE_, $(COMB))
COMB_STATIC	:= $(addsuffix .static, $(COMB))

TARGETS_REAL	:= $(filter-out $(COMB),$(PROGS))
TARGETS	:= $(PROGS)

ifeq ($(insmod_static),yes)
TARGETS_REAL	+= insmod.static
TARGETS		+= insmod.static $(COMB_STATIC)
endif

INSMODOBJS	:= insmod.o
MODINFOOBJS	:= modinfo.o
MODCLEANOBJS	:= modclean.o

ifeq (@COMMON_sparc@,yes)
INSMODOBJS	+= insmod_64.o
COMB		+= @COMBINE_kallsyms@_64
MODINFOOBJS	+= modinfo_64.o
DEFSNOARCH	+= -DCOMMON_3264
DEFS		+= -DONLY_32
DEFS64		:= -DONLY_64 -DELF_MACHINE_H='"elf_sparc64.h"' -DARCH_sparc64
endif

INSMODOBJS	+= $(addsuffix .o, $(COMB))

#=====================================================================

# Rule for building "to-be-combined" modutils object files
%.o: %.c
	$(CC) $(CFLAGS) $(DEFSNOARCH) $(DEFS) $(COMBDEFS) -c -o $@ $<

# Rule for building 64 bit versions, only used when building common code
# for 32 and 64 bit systems.
%_64.o: %.c
	$(CC) $(CFLAGS) $(DEFSNOARCH) $(DEFS64) $(COMBDEFS) -c -o $@ $<

# Rule for building "normal" modutils executables (non-combined)
%: %.c ../obj/libobj.a ../util/libutil.a
	$(CC) $(CFLAGS) $(DEFSNOARCH) $(DEFS) -o $@ $^ $(LDFLAGS)

#=====================================================================

all: .depend $(TARGETS)

modclean: $(MODCLEANOBJS) ../util/libutil.a
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

insmod: $(INSMODOBJS) ../obj/libobj.a ../util/libutil.a
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

insmod.static: $(INSMODOBJS) ../obj/libobj.a ../util/libutil.a
	$(CC) -static $(CFLAGS) -o $@ $^ $(LDFLAGS)

$(COMB): insmod
	ln -sf $< $@

$(COMB_STATIC): insmod.static
	ln -sf $< $@

modinfo: $(MODINFOOBJS) ../obj/libobj.a ../util/libutil.a
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

install install-bin: all
	@set -x;\
	for i in $(TARGETS_REAL); do \
	$(INSTALL) $(STRIP) $$i $(sbindir); done;
	for i in $(srcdir)/insmod_ksymoops_clean $(srcdir)/kernelversion; do \
	$(INSTALL) $$i $(sbindir); done;
	for i in $(COMB); do \
	ln -sf insmod $(sbindir)/$$i; \
	(test "$(insmod_static)" = yes && \
		ln -sf insmod.static $(sbindir)/$$i.static) || true; \
	done

clean:
	rm -f *.o $(PROGS) *.static

realclean: clean
	rm -f .depend

distclean: realclean
	rm -f Makefile

dep depend .depend: $(addsuffix .c, $(PROGS))
	$(CC) -M $(CFLAGS) $(DEFSNOARCH) $(DEFS) $^ > .depend

ifeq (.depend,$(wildcard .depend))
include .depend
endif