File: Makefile.DOS

package info (click to toggle)
pcal 4.10.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 1,216 kB
  • ctags: 928
  • sloc: ansic: 6,877; csh: 245; makefile: 146; perl: 117; sh: 61
file content (170 lines) | stat: -rw-r--r-- 5,831 bytes parent folder | download | duplicates (3)
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# 
# Makefile for 'pcal' under MS-DOS
#
# v4.10.0: Bill Marr
#    
#    Fix a problem whereby the specification of the memory model to be used
#    was missing from the link stage.  Explicitly specify the memory model as
#    a variable.  Document the available memory models and their use.
#    
#    Enable a run-time check for stack overflow conditions by compiling with 
#    the '-N' option.
#    
#    Accommodate the fact that the use of 'pcalinit.{c,ps,h}' is no longer
#    needed.  PostScript output is now directly generated by C code, without
#    the use of a PostScript template which is converted to a C header file.
#    
#    Eliminate other now-unused files ('pcalglob.h', 'pcalpapr.{c,h}') and add
#    new files ('encvec.c', 'pcallang.c').
#    
#    Specify proper header file dependencies.  Several of them were incorrect.
#    
#    Rename 'EPS' definition to 'EPS_DSC' (in order to more clearly show its
#    purpose and to avoid confusion with the embedded EPS image capability for
#    monthly calendars).
#    
#    Provide several enhancements to the comments.
#    
# v4.9.0: Bill Marr
# 
#    Use 'src/' now that source files are in their own subdirectory.
# 
#    Add '-DEPS' switch to get EPS-compliant PostScript output.
# 
# v4.8.0: Bill Marr
# 
#    Change compiler command line to work under Borland C++ v5.0
# 
# v4.5: "make clean" leaves pcal intact but removes other by-products;
#       "make clobber" blows everything away;
#       "make fresh" rebuilds pcal from scratch
#
# Uses TurboC or Borland C++ command line compiler:
#    
#    make -f Makefile.DOS
# 
# Define various directories for the following items:
# 
#    - source code
#    - object code
#    - installed 'pcal' executable
# 
# This 'make' file mimics the Unix 'Makefile' file, by defining separate
# directories for the source, the objects, and the executable.  However,
# unlike the Unix compilers, the Borland C (DOS) compiler had trouble with
# creating the objects and executable code in subdirectories, so for now,
# we're just using the same actual destination directory ('.') for both of
# them.
# 
SRCDIR	= src
OBJDIR	= .
EXECDIR	= .

# 
# Use the Borland C++ compiler (v5.0)...
# 
CC = bcc

# 
# Select the appropriate memory model:
# 
#    t = tiny     (code+data < 64K)
#    s = small    (code < 64K, data < 64K)
#    c = compact  (code < 64K, data < 16M)
#    m = medium   (code < 16M, data < 64K)
#    l = large    (code < 16M, data < 16M)
#    h = huge     (same as 'large', but allows > 64K total static data)
# 
MODEL = h

# 
# This flag controls the generation of EPS-like PostScript Document
# Structuring Conventions (DSC) so that the output contains enhanced comments
# ('%%Page:', etc.) that are necessary for programs like 'psnup' to do useful
# things with the generated calendars.  These comments also allow PostScript
# previewer applications to page up to the previous page.
# 
D_EPS_DSC = -DEPS_DSC

# 
# Enable certain compile flags:
#    
#    -DBUILD_ENV_MSDOS   declare that we're building for MS-DOS
# 
# Borland compiler flags:
#    
#    -m($MODEL)   use specified memory model
#    -N           check for 'stack overflow' condition
#    -v-          disable debugging information
#    -w-ccc       disable warning 'Condition is always true/false'
#    -w-pia       disable warning 'Possibly incorrect assignment'
#    -w-rch       disable warning 'Unreachable code in function xxx'
#    -w-rvl       disable warning 'Function should return a value in function xxx'
#    -w-par       disable warning 'Parameter xxx is never used in function xxx'
#    -w-aus       disable warning 'xxx is assigned a value that is never used in function xxx'
#    
CFLAGS	= -DBUILD_ENV_MSDOS $(D_EPS_DSC) -I$(SRCDIR) \
		-m$(MODEL) -N -v- -w-ccc -w-pia -w-rch -w-rvl -w-par -w-aus

OBJECTS = $(OBJDIR)\pcal.obj \
		$(OBJDIR)\encvec.obj $(OBJDIR)\exprpars.obj \
		$(OBJDIR)\moonphas.obj $(OBJDIR)\pcalutil.obj \
		$(OBJDIR)\pcallang.obj \
		$(OBJDIR)\readfile.obj $(OBJDIR)\writefil.obj

$(EXECDIR)\pcal.exe:	$(OBJECTS)
	$(CC) -m$(MODEL) $(LDFLAGS) $(OBJECTS)
	@ echo Build of 'pcal' for MS-DOS completed.

$(OBJDIR)\encvec.obj:	$(SRCDIR)/encvec.c
	$(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)/encvec.c

$(OBJDIR)\exprpars.obj:	$(SRCDIR)\exprpars.c $(SRCDIR)\pcaldefs.h \
			$(SRCDIR)\protos.h
	$(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\exprpars.c

$(OBJDIR)\moonphas.obj:	$(SRCDIR)\moonphas.c $(SRCDIR)\pcaldefs.h \
			$(SRCDIR)\pcallang.h \
			$(SRCDIR)\protos.h
	$(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\moonphas.c

$(OBJDIR)\pcal.obj:	$(SRCDIR)\pcal.c $(SRCDIR)\pcaldefs.h \
			$(SRCDIR)\pcallang.h \
			$(SRCDIR)\protos.h
	$(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\pcal.c

$(OBJDIR)\pcallang.obj:	$(SRCDIR)\pcallang.c $(SRCDIR)\pcallang.h \
			$(SRCDIR)\pcaldefs.h
	$(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\pcallang.c

$(OBJDIR)\pcalutil.obj:	$(SRCDIR)\pcalutil.c $(SRCDIR)\pcaldefs.h \
			$(SRCDIR)\pcallang.h \
			$(SRCDIR)\protos.h
	$(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\pcalutil.c

$(OBJDIR)\readfile.obj:	$(SRCDIR)\readfile.c $(SRCDIR)\pcaldefs.h \
			$(SRCDIR)\pcallang.h \
			$(SRCDIR)\protos.h
	$(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\readfile.c

$(OBJDIR)\writefil.obj:	$(SRCDIR)\writefil.c $(SRCDIR)\pcaldefs.h \
			$(SRCDIR)\pcallang.h \
			$(SRCDIR)\protos.h
	$(CC) $(CFLAGS) $(COPTS) -I$(OBJDIR) -c $(SRCDIR)\writefil.c

# 
# This target will delete everything except the 'pcal' executable.
# 
clean:
	del $(OBJDIR)\*.obj

# 
# This target will delete everything, including the 'pcal' executable.
# 
clobber: clean
	del $(EXECDIR)\pcal.exe

# 
# This target will delete everything and rebuild 'pcal' from scratch.
# 
fresh:	clobber pcal.exe