1#
2# set appropriate the following variables in your environment:
3#
4# CC		for the C compiler
5# CFLAGS	for options of CC
6# LDFLAGS	for linker options of CC
7#
8
9#
10# ARCH_EXT can be used in order to install binaries in different directories
11# depending on the computer architecture,
12# e.g. $(HOME)/lib/sunos for ARCH_EXT = '/sunos'
13#
14#ARCH_EXT	=
15
16#
17# set the path for the root of the inlude directories here,
18# e.g. /usr/local/include
19#
20INCROOT		= $(HOME)/include
21#
22# set the path for the root of the library directories here,
23# e.g. /usr/local/lib
24#
25LIBROOT		= $(HOME)/lib$(ARCH_EXT)
26#
27# set the destination directory for the executable
28#
29DEST		= $(HOME)/bin$(ARCH_EXT)
30
31#
32# the following text was created automaticaly. You should change it carefully.
33#
34
35SHELL		= /bin/sh
36
37PROGRAM		= lastest
38
39HDRS		=
40
41EXTHDRS		=
42
43SRCS		= lastest.c
44
45OBJS		= lastest.o
46
47LIBS		=
48
49EXTLIBS		= -llaspack -lxc
50
51COMPFLAGS	=
52
53# compiler options will be passed throuth enviroment variables
54#CFLAGS		=
55#PFLAGS		=
56#FFLAGS		=
57#CXXFLAGS	=
58
59BINLOCAL	= /usr/local/bin
60
61INSTALL		= mv
62
63LD		= $(CC)
64
65# linker options passed throuth enviroment variables
66#LDFLAGS	=
67
68LINTLIBS	=
69
70LINTFLAGS	= -I$(INCROOT) $(CFLAGS)
71
72MAKEFILE	= makefile
73
74PRINT		= pr
75
76PRINTFLAGS	=
77
78LP		= lp
79
80LPFLAGS		=
81
82all:		$(PROGRAM)
83
84clean:;		@rm -f $(OBJS) core
85
86clobber:;	@rm -f $(OBJS) $(PROGRAM) core tags
87		@if [ -f compllist ]; then rm -f compllist; fi
88		@if [ -f cleanlist ]; then rm -f cleanlist; fi
89		@find . -type f -print > compllist
90		@sed -n \
91			-e "/~/ w cleanlist" \
92			-e '/%/ w cleanlist' \
93			-e '/.bak/ w cleanlist' \
94			-e '/.obj/ w cleanlist' \
95			-e '/.exe/ w cleanlist' \
96			-e '/.aux/ w cleanlist' \
97			-e '/.blg/ w cleanlist' \
98			-e '/.dvi/ w cleanlist' \
99			-e '/.glo/ w cleanlist' \
100			-e '/.idx/ w cleanlist' \
101			-e '/.ilg/ w cleanlist' \
102			-e '/.ind/ w cleanlist' \
103			-e '/.lof/ w cleanlist' \
104			-e '/.log/ w cleanlist' \
105			-e '/.lot/ w cleanlist' \
106			-e '/.toc/ w cleanlist' \
107			compllist
108		@rm -f `cat cleanlist`
109		@rm -f compllist
110		@rm -f cleanlist
111
112depend:;	@mkmf -f $(MAKEFILE)
113
114echo:;		@echo $(HDRS) $(SRCS)
115
116index:;		@ctags -wx $(HDRS) $(SRCS)
117
118install:	$(PROGRAM)
119		@echo Installing $(PROGRAM) in $(DEST)
120		@strip $(PROGRAM)
121		@if [ $(DEST) != . ]; then rm -f $(DEST)/$(PROGRAM); fi
122		@if [ $(DEST) != . ]; then $(INSTALL) -f $(PROGRAM) $(DEST); fi
123
124install-local:	$(PROGRAM)
125		@echo Installing $(PROGRAM) in $(BINLOCAL)
126		@strip $(PROGRAM)
127		@rm -f $(BINLOCAL)/$(PROGRAM).old
128		@if [ -f $(BINLOCAL)/$(PROGRAM) ]; then \
129			mv $(BINLOCAL)/$(PROGRAM) $(BINLOCAL)/$(PROGRAM).old; \
130		fi
131		@$(INSTALL) -f $(PROGRAM) $(BINLOCAL)
132		@chmod 755 $(BINLOCAL)/$(PROGRAM)
133
134lint:		$(LINTLIBS) $(HDRS) $(EXTHDRS) $(SRCS)
135		@$(LINT) $(LINTFLAGS) $(LINTLIBS) $(SRCS)
136
137print:;		@$(PRINT) $(PRINTFLAGS) $(HDRS) $(SRCS) | $(LP) $(LPFLAGS)
138
139tags:           $(HDRS) $(SRCS)
140		@ctags $(HDRS) $(SRCS)
141
142touch:;		@touch $(HDRS) $(SRCS) $(MAKEFILE)
143
144update:		$(DEST)/$(PROGRAM)
145
146d2u:;		@d2u $(HDRS) $(SRCS)
147
148c:;		@$(MAKE) -f $(MAKEFILE) clean
149cl:;		@$(MAKE) -f $(MAKEFILE) clobber
150i:;             @$(MAKE) -f $(MAKEFILE) install
151il:;		@$(MAKE) -f $(MAKEFILE) install-local
152l:;		@$(MAKE) -f $(MAKEFILE) lint
153t:;		@$(MAKE) -f $(MAKEFILE) touch
154u:;		@$(MAKE) -f $(MAKEFILE) update
155
156$(PROGRAM):     $(OBJS) $(LIBS) $(MAKEFILE)
157		@echo "Linking $(PROGRAM) ..."
158		@$(LD) $(COMPFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM) \
159			-L$(LIBROOT) $(EXTLIBS) $(LDFLAGS) -lm
160
161$(DEST)/$(PROGRAM):  $(HDRS) $(EXTHDRS) $(SRCS) $(LIBS)
162		@$(MAKE) -f $(MAKEFILE) install:
163
164.c.o:;		$(CC) -I$(INCROOT) $(CFLAGS) $(COMPFLAGS) -c $<
165.p.o:;		pc $(PFLAGS) $(COMPFLAGS) -c $<
166.f.o:;		f77 $(FFLAGS) $(COMPFLAGS) -c $<
167