/[magpie]/magpie/Makefile
ViewVC logotype

Contents of /magpie/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Aug 31 12:17:58 2003 UTC (9 years, 8 months ago) by djpig-guest
Branch: MAIN
CVS Tags: upstream_version_0_6, debian_version_0_6, HEAD
Changes since 1.4: +3 -2 lines
finetuning clean target.
1 # How to use this ? -DOUTPUT_DIR="" jfs
2 #LIBS = -lm -lccmalloc -ldl
3 #LIBS = -lm -lefence -- requires too much memory
4 #LIBS = -lm -ldebauch
5
6 AR = ar
7 ARFLAGS = cr
8 RM = rm -f
9 MV = mv
10
11 INSTALL = install
12 INSTALL_DATA = install -m 644
13 INSTALL_EXE = install -m 755
14
15 YACC = bison
16 YFLAGS = -dtv
17 LEX = flex
18 GPERF = gperf
19 CFLAGS = -g -O2 -Wall
20
21 LIBS = -lm
22
23 AUTOGEN_PROGRAM = $(shell autoopts-config --autogen)
24 AUTOGEN_DATADIR = $(shell autoopts-config --pkgdatadir)
25 AUTOGEN_FLAGS = -L$(AUTOGEN_DATADIR)
26
27 AUTOGEN_CFLAGS = $(shell autoopts-config --cflags)
28 AUTOGEN_LDFLAGS = $(shell autoopts-config --libs)
29
30 CFLAGS += $(AUTOGEN_CFLAGS)
31 LIBS += $(AUTOGEN_LDFLAGS)
32
33 all: magpie
34
35 LIB=libdpkginfo.a
36
37 OBJS := parser.o scanner.o tags.o tokens.o support.o mod_core.o \
38 mod_html.o mod_debian.o mod_xml.o mod_docbook.o mod_debiandoc.o \
39 mod_texinfo.o magpieopts.o \
40 mod_sections.o mod_priorities.o mod_tasks.o mod_installed.o \
41 mod_names.o mod_maintainers.o mod_sources.o mod_md5sums.o \
42 mod_sizes.o mod_isizes.o mod_conffiles.o mod_keywords.o \
43 # mod_setuids.o
44
45 $(LIB): $(LIB)($(OBJS))
46
47 .y.a:
48 $(YACC) $(YFLAGS) $<
49 @$(MV) ${<:.y=.tab.c} ${<:.y=.c}
50 @$(CC) -c $(CFLAGS) ${<:.y=.c}
51 @$(AR) $(ARFLAGS) $@ $%
52 @$(RM) $% ${<:.y=.c}
53
54 .l.a:
55 $(LEX) $<
56 @$(MV) lex.yy.c ${<:.l=.c}
57 @$(CC) -c $(CFLAGS) ${<:.l=.c}
58 @$(AR) $(ARFLAGS) $@ $%
59 @$(RM) $% ${<:.l=.c}
60
61 .g.a:
62 $(GPERF) -tCD tags.g > tags.c
63 @$(CC) -c $(CFLAGS) ${<:.g=.c}
64 @$(AR) $(ARFLAGS) $@ $%
65 # @$(RM) $% ${<:.g=.c}
66
67 $(LIB)(parser.o): parser.y
68 $(LIB)(scanner.o): scanner.l parser.h
69
70 $(LIB)(tags.o): tags.g
71 $(GPERF) -tCD -N in_word_set_${<:.g=} $< > ${<:.g=.c}
72 @$(CC) -c $(CFLAGS) ${<:.g=.c}
73 @$(AR) $(ARFLAGS) $@ $%
74 # @$(RM) $% ${<:.g=.c}
75
76 $(LIB)(tokens.o): tokens.g
77 $(GPERF) -tCD -N in_word_set_${<:.g=} $< > ${<:.g=.c}
78 @$(CC) -c $(CFLAGS) ${<:.g=.c}
79 @$(AR) $(ARFLAGS) $@ $%
80 # @$(RM) $% ${<:.g=.c}
81
82 magpie: magpie.c magpieopts.c magpie.h $(LIB)
83 $(CC) -o $@ $(CFLAGS) $< $(LIB) $(LIBS)
84
85 parser.h: parser.y
86 $(YACC) $(YFLAGS) parser.y
87 $(MV) parser.tab.h parser.h
88 $(RM) parser.tab.c
89
90 %.c: %.def
91 $(AUTOGEN_PROGRAM) $(AUTOGEN_FLAGS) $<
92
93 cxref:
94 cxref -I/usr/include/linux \
95 -D__gnuc_va_list=__ptr_t \
96 -Dtime_t=__kernel_time_t \
97 -Dsuseconds_t=__kernel_suseconds_t \
98 -Dwchar_t=int \
99 -Dsize_t=int \
100 -Dva_list=__gnuc_va_list \
101 -DDIR="struct __dirstream" \
102 -xref -html32 *.c
103 $(INSTALL) -d doc
104 mv cxref* *html doc
105
106 install:
107 $(INSTALL) -d $(DESTDIR)/usr/sbin
108 $(INSTALL_EXE) magpie $(DESTDIR)/usr/sbin
109
110 $(INSTALL) -d $(DESTDIR)/usr/share/man/man8
111 $(INSTALL_DATA) magpie.8 $(DESTDIR)/usr/share/man/man8
112
113 clean:
114 $(RM) *.o *.a parser.c scanner.c tags.c tokens.c parser.output
115 $(RM) *~ parser.tab.h
116 $(RM) magpie
117 $(RM) cxref.* *c.html
118 $(RM) -r doc
119 $(RM) magpieopts.c magpieopts.h
120
121 realclean: clean
122 $(RM) parser.h

  ViewVC Help
Powered by ViewVC 1.1.5