Makefile.dsg revision 128346
1# Makefile for less under DJGPP v2.0 or later.
2
3#### Start of system configuration section. ####
4
5srcdir = .
6VPATH = .
7
8CC = gcc
9INSTALL = ginstall -c
10INSTALL_PROGRAM = ginstall
11INSTALL_DATA = ginstall -m 644
12AWK = gawk
13
14CFLAGS = -O2 -g
15CFLAGS_COMPILE_ONLY = -c
16#LDFLAGS = -s
17LDFLAGS = -g
18O=o
19
20LIBS =
21prefix = /dev/env/DJDIR
22exec_prefix = ${prefix}
23
24bindir = ${exec_prefix}/bin
25sysconfdir = ${prefix}/etc
26mandir = ${prefix}/man
27manext = 1
28
29#### End of system configuration section. ####
30
31# This rule allows us to supply the necessary -D options
32# in addition to whatever the user asks for.
33.c.o:
34	${CC} -I. ${CFLAGS_COMPILE_ONLY} -DBINDIR=\"${bindir}\" -DSYSDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS} $<
35
36OBJ =	main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
37	command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
38	help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
39	lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
40	output.${O} position.${O} prompt.${O} search.${O} signal.${O} \
41	tags.${O} ttyin.${O} version.${O}
42
43all: less lesskey lessecho
44
45less: ${OBJ}
46	${CC} ${LDFLAGS} -o $@ ${OBJ} ${LIBS}
47
48lesskey: lesskey.${O} version.${O}
49	${CC} ${LDFLAGS} -o $@ lesskey.${O} version.${O}
50
51lessecho: lessecho.${O} version.${O}
52	${CC} ${LDFLAGS} -o $@ lessecho.${O} version.${O}
53
54defines.h: defines.ds
55	command.com /c copy $< $@
56
57${OBJ}: ${srcdir}/less.h defines.h ${srcdir}/funcs.h
58
59install: all ${srcdir}/less.man ${srcdir}/lesskey.man
60	${INSTALL_PROGRAM} less.exe ${bindir}/less.exe
61	${INSTALL_PROGRAM} lesskey.exe ${bindir}/lesskey.exe
62	${INSTALL_PROGRAM} lessecho.exe ${bindir}/lessecho.exe
63	${INSTALL_DATA} ${srcdir}/less.man ${mandir}/man${manext}/less.${manext}
64	${INSTALL_DATA} ${srcdir}/lesskey.man ${mandir}/man${manext}/lesskey.${manext}
65
66info:
67install-info:
68dvi:
69check:
70installcheck:
71
72TAGS:
73	etags *.c *.h
74
75newfuncs:
76	command.com /c if exist funcs.h del funcs.h
77	${AWK} -f mkfuncs.awk ${OBJ:.${O}=.c} > funcs.h
78
79clean:
80	command.com /c for %f in (*.${O} less lesskey lessecho *.exe) do if exist %f del %f
81
82mostlyclean: clean
83
84distclean: clean
85	command.com /c if not exist Makefile.dsg ren Makefile Makefile.dsg
86	command.com /c if not exist defines.ds ren defines.h defines.ds
87	command.com /c for %f in (Makefile defines.h) do if exist %f del %f
88
89realclean: distclean
90	command.com /c if exist TAGS del TAGS
91
92