1# MSDOS Makefile for ATP editline library
2#
3# For use with most versions of MAKE for MSDOS. However users of Borland
4# MAKE should delete or comment out the following three lines.
5.SWAP :
6.SUFFIXES :
7.SUFFIXES : .obj .c
8
9# This makefile was tested with several versions of make for MSDOS:
10# nmake, pdmake, dmake, ndmake 4.3, and gymake. Borland make will work
11# if you follow the previous instructions. Note that ndmake 4.5 is not
12# recommended, use ndmake 4.3 instead. GNU make is not recommended for
13# use with this particular makefile. The compilers tested were Borland
14# Turbo C++ and Microsoft Quick C 2.01.
15
16# uncomment the following eight lines for Microsoft Quick C
17CC	= qcl
18AR	= lib
19ARFLAG	= /NOI
20LD	= link
21LDFLAG	= /BA /LI
22DEFS	= /D_MSC_ /D__MSDOS__ /DDESQVP
23OFLAGS	= /Ox /Gs /Za /AL
24WARN	= /W3
25# uncomment the following eight lines for Borland Turbo C/C++
26#CC	= tcc
27#AR	= tlib
28#ARFLAG	= /c
29#LD	= tlink
30#LDFLAG = /c /d
31#DEFS	= -DDESQVP
32#OFLAGS	= -O -G -a -d -k- -f- -ml
33#WARN	= -w
34
35
36CFLAGS	= -I.. $(WARN) $(CPLUS_) $(OFLAGS) $(DEFS)
37SRC	= editline.c complete.c sysdos.c
38OBJ	= editline.obj complete.obj sysdos.obj
39BSHELL	= command /c
40RM	= $(BSHELL) ..\RMV.BAT
41CP	= $(BSHELL) copy
42MV	= $(BSHELL) ren
43LINT	= tlint
44LINTFG	= $(DEFS)
45FORCEMAKE = FO.RCE
46
47.c.obj:
48	$(CC) $(CFLAGS) -c $<
49
50all : libedit.lib testit.exe
51
52libedit.lib : $(OBJ)
53	$(RM) libedit.lib
54	$(AR) libedit.lib $(ARFLAG) +editline +complete +sysdos , libedit.map
55
56testit.exe : testit.obj libedit.lib
57	$(LD) $(LDFLAG) testit.obj,testit,testit,libedit.lib
58
59..\rmv.bat : ..\utils\batch\rmv.in
60	$(CP) ..\utils\batch\rmv.in ..\rmv.bat
61
62clean : ..\rmv.bat $(FORCEMAKE)
63	@$(RM) *.obj *.lib core testit.exe
64
65mclean : clean
66	@$(RM) edlint *.ln *.map
67
68clobber : clean
69	@$(RM) *.a *.o *.ln *.lst *.map makefile.trb
70
71mostlyclean : mclean
72
73# lint rules
74lint : $(FORCEMAKE)
75	$(LINT) -T -I.. -oedlint $(LINTFG) editline.c complete.c sysdos.c
76
77libedit.ln : edlproto.h
78	$(LINT) $(LINTFG) -D__LINTLIB__ edlproto.h -L libedit.ln
79
80# phony rule is empty and is used to$(FORCEMAKE) unconditional build of targets
81$(FORCEMAKE) :
82	@$(BSHELL) rem
83
84memchk: $(FORCEMAKE)
85	chkdsk c:
86
87editline.obj : editline.c editline.h msdos.h edlproto.h ../atptypes.h \
88 edpublic.h ../reader.h ../globals.h ../system.h ../readlib.h
89complete.obj : complete.c editline.h msdos.h edlproto.h edpublic.h ../atptypes.h
90sysdos.obj : sysdos.c editline.h msdos.h
91testit.obj : testit.c editline.h msdos.h edlproto.h ../atptypes.h
92#
93# end of Makefile
94