aboutsummaryrefslogtreecommitdiff
path: root/Makefile.vc
blob: d2405a35de532b3b93809f67a3292d281d507b4a (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
SRCDIR =.

!ifdef DEBUG
OUTDIR =Debug
CFLAGS =-Od -Zi -GZ -MDd -D_DEBUG
LDFLAGS=-debug:full -debugtype:cv
!else
OUTDIR =Release
CFLAGS =-O2 -Op -Gs -MD -DNDEBUG
LDFLAGS=-release -opt:ref -opt:icf,3
!endif

TMPDIR =$(OUTDIR)\Objects

OBJS   = \
	$(TMPDIR)\jim.obj

CC     =cl -nologo
LD     =link -nologo

CFLAGS =$(CFLAGS) -W3 -GX -Fd$(TARGET:.dll=.pdb) -YX -Fp$(TMPDIR)^\
INC    =-I../metakit/include -I/opt/include
DEFS   =-DWIN32
LIBS   =


all:    jim
jim:    setup $(OUTDIR)\jim.exe

$(OUTDIR)\jim.exe: $(OBJS)
	$(LD) $(LDFLAGS) -out:$@ $** $(LIBS)

#-------------------------------------------------------------------------
setup:
	@if not exist $(OUTDIR) mkdir $(OUTDIR)
	@if not exist $(TMPDIR) mkdir $(TMPDIR)


test: testapp
	@if exist ztest.mk del ztest.mk >NUL
	@$(OUTDIR)\testapp.exe
	kviewer ztest.mk

clean:
        @if exist $(TMPDIR) rmdir /q /s $(TMPDIR) >NUL

realclean: clean
        @if exist $(OUTDIR) rmdir /q /s $(OUTDIR) >NUL

#-------------------------------------------------------------------------

.SUFFIXES:.c .cpp

{$(SRCDIR)}.c{$(TMPDIR)}.obj::
        $(CC) $(CFLAGS) $(DEFS) $(INC) -Fo$(TMPDIR)^\ -c @<<
$<
<<

{$(SRCDIR)}.cpp{$(TMPDIR)}.obj::
        $(CC) $(CFLAGS) $(DEFS) $(INC) -Fo$(TMPDIR)^\ -c @<<
$<
<<

#-------------------------------------------------------------------------