forked from JWasm/JWasm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOC.mak
80 lines (60 loc) · 1.47 KB
/
OC.mak
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
# this makefile (NMake) creates the JWasm Win32 binary with Orange C.
name = jwasm
# directory paths to adjust
# CCDIR - root directory for compiler, linker, include and lib files
!ifndef CCDIR
CCDIR = \OC386
!endif
!ifndef DEBUG
DEBUG=0
!endif
!ifndef OUTD
!if $(DEBUG)
OUTD=OCD
!else
OUTD=OCR
!endif
!endif
inc_dirs = -IH -I"$(CCDIR)\include"
linker = $(CCDIR)\bin\olink.exe
!if $(DEBUG)
extra_c_flags = -DDEBUG_OUT
!else
extra_c_flags = -DNDEBUG
!endif
c_flags =-D__NT__ $(extra_c_flags)
#lflags stuff
#########
LOPT =
!if $(DEBUG)
LOPTD =
!endif
lflagsw = $(LOPTD) $(LOPT)
CC=$(CCDIR)\bin\occ.exe /c /C+F -D__OCC__ $(inc_dirs) $(c_flags)
.c{$(OUTD)}.o:
@set ORANGEC=$(CCDIR)
@set PATH=$(CCDIR)\bin;%PATH%
@$(CC) -o$* $<
!include gccmod.inc
ALL: $(OUTD) $(OUTD)\$(name).exe
$(OUTD):
@mkdir $(OUTD)
$(OUTD)\$(name).exe : $(OUTD)/main.o $(proj_obj)
@set ORANGEC=$(CCDIR)
@set PATH=$(CCDIR)\bin;%PATH%
$(linker) /c /T:CON32 /m /o$(OUTD)\$(name) @<<
$(lflagsw) /L$(CCDIR)\Lib $(OUTD)\main.o $(proj_obj:/=\) c0xpe.o "clwin.l" "climp.l"
<<
$(OUTD)/msgtext.o: msgtext.c H/msgdef.h H/globals.h
@set ORANGEC=$(CCDIR)
@set PATH=$(CCDIR)\bin;%PATH%
@$(CC) -o$* msgtext.c
$(OUTD)/reswords.o: reswords.c H/instruct.h H/special.h H/directve.h
@set ORANGEC=$(CCDIR)
@set PATH=$(CCDIR)\bin;%PATH%
@$(CC) -o$* reswords.c
######
clean:
@erase $(OUTD)\*.exe
@erase $(OUTD)\*.o
@erase $(OUTD)\*.map