summaryrefslogtreecommitdiff
path: root/Mkfiles/Makefile.wcd
blob: 7a82e59753c4392c74d7099fe8ed6ab863cd4cb5 (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
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
# host: watcom c (dos, windows, os/2)
# target: dos 16bit
# Makefile for the Netwide Assembler
#
# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
# Julian Hall. All rights reserved. The software is
# redistributable under the licence given in the file "Licence"
# distributed in the NASM archive.
#
# this makefile is designed for use with the OpenWatcom C
# compiler, it generates dos 16 bit executable
# it has been tested with
# OpenWatcom wmake.exe /u 1.1-rc1 (remember about that /u option :)
#
# Tested with OpenWatcom 1.1-rc1.
# MAKE SURE THE "WATCOM" ENVIRONMENT VARIABLE IS SET TO THE
# OPENWATCOM INCLUDE DIRECTORY!

# output formats
OUTFORMS = -DOF_ONLY -DOF_BIN -DOF_OBJ -DOF_WIN32 -DOF_AS86

# compiler flags
CFLAGS   = -fpi -ml -j -s -bt=dos -ohk -zp1 -os -zt32 -I$(%WATCOM)\h $(OUTFORMS)
# -fpi    inline math + emulation
# -ml     large model
# -j	  signed char
# -s      no stack checking
# -bt=dos target system - dos
# -ohk	  optimizations
# -zp1    don't align structure members
# -os     optimize for size
# -zt32   put objects > 32 bytes in separate segments

# compiler
CC = wcc $(CFLAGS)
# linker flags
LDFLAGS = 
# linker
LD = wcl
# object file extension
OBJ = obj

# Where C directories live
.c : .;.\output\

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

NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
           assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \
	   outbin.$(OBJ) outaout.$(OBJ) outcoff.$(OBJ) \
	   outelf32.$(OBJ) outelf64.$(OBJ) outobj.$(OBJ) outas86.$(OBJ) \
	   outrdf.$(OBJ) outdbg.$(OBJ) \
	   preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ) outrdf2.$(OBJ) \
	   outieee.$(OBJ)

NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \
	      insnsd.$(OBJ)

.NOCHECK
all : nasm.exe ndisasm.exe
        rem This is dummy command for dumb make

nasm.exe: $(NASMOBJS)
	$(LD) $(LDFLAGS) -fe=nasm.exe $(NASMOBJS)

ndisasm.exe: $(NDISASMOBJS)
	$(LD) $(LDFLAGS) -fe=ndisasm.exe $(NDISASMOBJS)

# linker response files
nasm.lnk: $(NASMOBJS)
	%create $@
	%append $@ N nasm.exe
	for %i in ($(NASMOBJS)) do %append $@ F %i

ndisasm.lnk:
	%create $@
	%append $@ N nasm.exe
	for %i in ($(NDISASMOBJS)) do %append $@ F %i

clean :	.SYMBOLIC
        -del *.obj
        -del *.lnk
        -del nasm.exe
        -del ndisasm.exe

#-- Magic hints to mkdep.pl --#
# @object-ending: ".$(OBJ)"
# @path-separator: ""	# This means kill the path completely
#-- Everything below is generated by mkdep.pl - do not edit --#
assemble.$(OBJ): assemble.c preproc.h insns.h regs.h regflags.c config.h \
 version.h nasmlib.h nasm.h regvals.c insnsi.h assemble.h
disasm.$(OBJ): disasm.c insns.h sync.h regdis.c regs.h config.h regs.c \
 version.h nasm.h insnsn.c names.c insnsi.h disasm.h
eval.$(OBJ): eval.c labels.h eval.h regs.h config.h version.h nasmlib.h \
 nasm.h
float.$(OBJ): float.c regs.h config.h version.h nasm.h
insnsa.$(OBJ): insnsa.c insns.h regs.h config.h version.h nasm.h insnsi.h
insnsd.$(OBJ): insnsd.c insns.h regs.h config.h version.h nasm.h insnsi.h
insnsn.$(OBJ): insnsn.c
labels.$(OBJ): labels.c regs.h config.h version.h nasmlib.h nasm.h
listing.$(OBJ): listing.c regs.h config.h version.h nasmlib.h nasm.h \
 listing.h
macros.$(OBJ): macros.c
names.$(OBJ): names.c regs.c insnsn.c
nasm.$(OBJ): nasm.c labels.h preproc.h insns.h parser.h eval.h regs.h \
 outform.h config.h version.h nasmlib.h nasm.h assemble.h insnsi.h listing.h
nasmlib.$(OBJ): nasmlib.c insns.h regs.h config.h regs.c version.h nasmlib.h \
 nasm.h insnsn.c names.c insnsi.h
ndisasm.$(OBJ): ndisasm.c insns.h sync.h regs.h config.h version.h nasmlib.h \
 nasm.h insnsi.h disasm.h
outform.$(OBJ): outform.c regs.h config.h outform.h version.h nasm.h
outaout.$(OBJ): outaout.c regs.h outform.h config.h version.h nasmlib.h \
 nasm.h
outas86.$(OBJ): outas86.c regs.h outform.h config.h version.h nasmlib.h \
 nasm.h
outbin.$(OBJ): outbin.c labels.h eval.h regs.h outform.h config.h version.h \
 nasmlib.h nasm.h
outcoff.$(OBJ): outcoff.c regs.h outform.h config.h version.h nasmlib.h \
 nasm.h
outdbg.$(OBJ): outdbg.c regs.h outform.h config.h version.h nasmlib.h nasm.h
outelf32.$(OBJ): outelf32.c regs.h outform.h config.h version.h nasmlib.h \
 nasm.h
outelf64.$(OBJ): outelf64.c regs.h outform.h config.h version.h nasmlib.h \
 nasm.h
outieee.$(OBJ): outieee.c regs.h outform.h config.h version.h nasmlib.h \
 nasm.h
outmacho.$(OBJ): outmacho.c compiler.h regs.h outform.h config.h version.h \
 nasmlib.h nasm.h
outobj.$(OBJ): outobj.c regs.h outform.h config.h version.h nasmlib.h nasm.h
outrdf.$(OBJ): outrdf.c regs.h outform.h config.h version.h nasmlib.h nasm.h
outrdf2.$(OBJ): outrdf2.c rdoff.h regs.h outform.h config.h version.h \
 nasmlib.h nasm.h
parser.$(OBJ): parser.c insns.h parser.h float.h regs.h regflags.c config.h \
 version.h nasmlib.h nasm.h insnsi.h
preproc.$(OBJ): preproc.c macros.c regs.h config.h version.h nasmlib.h \
 nasm.h
regdis.$(OBJ): regdis.c
regflags.$(OBJ): regflags.c
regs.$(OBJ): regs.c
regvals.$(OBJ): regvals.c
sync.$(OBJ): sync.c sync.h