aboutsummaryrefslogtreecommitdiff
path: root/Makefile.wcc
blob: 57684f2a2765b56b0b7d707809acc48ea789ca52 (plain)
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
# This is an OpenWatcom 1.9 Makefile, that should work
# both when hosted on DOS and on Linux.
#
# NOTE: owsetenv.sh on Linux might not set up
# the environment for targetting DOS.
# You should have $WATCOM set and the binl/binl64 directory
# added to $PATH.
CC = wcc
LD = wlink

!ifdef DEBUG
# You can also -dDEBUG or even -dDEBUG1.
CFLAGS = -d2 -od
#-dDEBUG1
LDFLAGS = debug all
!else
# For the fastest code (C Guide, p.70):
# -onatx -oh
CFLAGS = -d0 -onasx -oh
!endif

# NOTE: Referencing @WCC_DEFS is a workaround for command line length
# restrictions when building under DOS.
# Perhaps it would be more elegant to have a DOS-specific config.h.
#
# Large data model: far code and data pointers
CFLAGS += -q -wx -ze -zm -j -0 -ml -bt=DOS @WCC_DEFS
LDFLAGS += format dos option eliminate option map option stack=16k &
           libpath $(%WATCOM)/lib286:$(%WATCOM)/lib286/dos

.BEFORE
!ifndef %WATCOM
	set WATCOM=/usr/bin/watcom
!endif
	set include=$(%WATCOM)/h
	set lib=$(%WATCOM)/lib286;$(%WATCOM)/lib286/dos
	set WCC_DEFS=-dSTDC_HEADERS=1 -dHAVE_STDIO_H -dHAVE_CTYPE_H -dHAVE_ERRNO_H &
	             -dHAVE_STRING_H -dHAVE_STRINGS_H -dHAVE_FCNTL_H -dHAVE_IO_H &
	             -dHAVE_SYS_STAT_H -dHAVE_SIGNAL_H -dHAVE_STDLIB_H -dHAVE_UNISTD_H &
	             -dHAVE_STDINT_H -dHAVE_DIRECT_H -dHAVE_I86_H &
	             -dHAVE_SBRK -dHAVE_STRCHR -dTERMCAP -d__WATCOM_LFN__

all : teco.exe .SYMBOLIC

teco.exe : tecbuf.obj teccmd.obj tecdebug.obj tecdisp.obj tecexec.obj &
           tecmem.obj teco.obj tecparse.obj tecstate.obj tecterm.obj tecundo.obj
	set WLINK_OBJ=$(LDFLAGS) name $@ file { $< }
	$(LD) @WLINK_OBJ

.c.obj:
	$(CC) $(CFLAGS) -fo=$@ $<

clean: .SYMBOLIC
	rm -f teco.exe
	rm *.obj