forked from zecruel/CadZinho
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.msvc
106 lines (90 loc) · 3.99 KB
/
Makefile.msvc
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
# Make file for CadZinho on Windows Visual C++ version
# Yuguo Zhang <[email protected]>
# This makefile is for using Visual C++ with nmake.
# Usage for Microsoft:
# nmake -f Makefile.msvc
# For debug versions define DEBUG on the command line:
# nmake DEBUG=1 -f Makefile.msvc
# For x86_64 versions define WIN64 on the command line:
# nmake WIN64=1 -f Makefile.msvc
CXX=cl
LD=link
RC=rc
DIR_O=.\obj
DIR_BIN=bin
EXE=$(DIR_BIN)\CadZinho.exe
#
# CadZinho depends on lua 5.4, libsdl 2 and glew
# for libsdl, you can fetch the runtime binaries and development libraries \
# at http://libsdl.org/download-2.0.php
# for lua and glew, you should build them yourself
# just modify the following directories
INCLUDES = -I $(ZSDK)/include -I $(ZSDK)/include/lua -I $(ZSDK)/include/SDL2
LIBRARIES = $(ZSDK)/lib/x64/lua.lib $(ZSDK)/lib/x64/glew.lib \
$(ZSDK)/lib/x64/SDL2.lib $(ZSDK)/lib/x64/SDL2main.lib \
$(ZSDK)/lib/x64/sqlite3.lib
LIBS=$(LIBRARIES) opengl32.lib Shell32.lib
CXX_BASE_FLAGS = /nologo /W4 -D_WINDOWS -D_WIN32 \
-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_DEPRECATE=1 -D_SCL_SECURE_NO_WARNINGS=1 \
/Zi /GR /EHa /Zc:wchar_t /Fd$(DIR_O)/ \
-D_USE_MATH_DEFINES -DSKIP_ATTRIBUTE \
$(INCLUDES)
LD_BASE_FLAGS = /nologo
!IFDEF WIN64
CXX_ARCH_FLAGS = -D_WIN64 -D_AMD64_
LD_ARCH_FLAGS = /MACHINE:X64
!ELSE
CXX_ARCH_FLAGS = -D_X86_=1
LD_ARCH_FLAGS = /MACHINE:X86
!ENDIF
!IFDEF DEBUG
CXX_OPT_FLAGS = -D_DEBUG /Od /MTd
LD_OPT_FLAGS = /DEBUG /SUBSYSTEM:CONSOLE
!ELSE
CXX_OPT_FLAGS = -DNDEBUG /O2 /MT
LD_OPT_FLAGS = /DEBUG /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup
!ENDIF
CXXFLAGS = $(CXX_BASE_FLAGS) $(CXX_OPT_FLAGS) $(CXX_ARCH_FLAGS)
LDFLAGS = $(LD_BASE_FLAGS) $(LD_OPT_FLAGS) $(LD_ARCH_FLAGS)
all: $(EXE)
OBJS=\
$(DIR_O)\bmp.obj $(DIR_O)\_dirent.obj $(DIR_O)\draw_gl.obj $(DIR_O)\dxf.obj \
$(DIR_O)\dxf_attract.obj $(DIR_O)\dxf_copy.obj $(DIR_O)\dxf_create.obj \
$(DIR_O)\dxf_dim.obj $(DIR_O)\dxf_edit.obj $(DIR_O)\dxf_ent.obj \
$(DIR_O)\dxf_export.obj $(DIR_O)\dxf_graph.obj $(DIR_O)\dxf_hatch.obj $(DIR_O)\dxf_image.obj \
$(DIR_O)\dxf_math.obj $(DIR_O)\dxf_print.obj $(DIR_O)\font.obj $(DIR_O)\graph.obj \
$(DIR_O)\gui.obj $(DIR_O)\gui_attrib.obj $(DIR_O)\gui_block.obj \
$(DIR_O)\gui_circle.obj $(DIR_O)\gui_config.obj \
$(DIR_O)\gui_dim.obj $(DIR_O)\gui_dupli.obj \
$(DIR_O)\gui_edit_attr.obj $(DIR_O)\gui_edit_text.obj \
$(DIR_O)\gui_ellip.obj $(DIR_O)\gui_explode.obj $(DIR_O)\gui_export.obj \
$(DIR_O)\gui_file.obj $(DIR_O)\gui_find.obj $(DIR_O)\gui_hatch.obj \
$(DIR_O)\gui_image.obj $(DIR_O)\gui_info.obj $(DIR_O)\gui_insert.obj \
$(DIR_O)\gui_lay.obj $(DIR_O)\gui_line.obj $(DIR_O)\gui_ltype.obj \
$(DIR_O)\gui_measure.obj $(DIR_O)\gui_mirror.obj $(DIR_O)\gui_move.obj \
$(DIR_O)\gui_mtext.obj $(DIR_O)\gui_paste.obj $(DIR_O)\gui_pline.obj \
$(DIR_O)\gui_plugins.obj $(DIR_O)\gui_point.obj \
$(DIR_O)\gui_print.obj $(DIR_O)\gui_prop.obj $(DIR_O)\gui_rect.obj \
$(DIR_O)\gui_rotate.obj $(DIR_O)\gui_scale.obj $(DIR_O)\gui_script.obj \
$(DIR_O)\gui_select.obj $(DIR_O)\gui_spline.obj $(DIR_O)\gui_text.obj \
$(DIR_O)\gui_toolbox.obj $(DIR_O)\gui_tstyle.obj $(DIR_O)\gui_txt_prop.obj \
$(DIR_O)\gui_vertex.obj $(DIR_O)\gui_xy.obj $(DIR_O)\gui_zoom.obj \
$(DIR_O)\hatch_pat.obj \
$(DIR_O)\i_svg_media.obj $(DIR_O)\list.obj $(DIR_O)\ltype.obj \
$(DIR_O)\main.obj \
$(DIR_O)\miniz.obj $(DIR_O)\pdfgen.obj $(DIR_O)\rref.obj \
$(DIR_O)\script.obj $(DIR_O)\shape.obj $(DIR_O)\shp_font.obj \
$(DIR_O)\tt_graph.obj $(DIR_O)\util.obj $(DIR_O)\yxml.obj
$(EXE): $(OBJS) $(DIR_O)\cz.res
$(LD) $(LDFLAGS) -OUT:$@ $(OBJS) $(DIR_O)\cz.res $(LIBS)
clean:
-del /q $(DIR_O)\*.obj $(DIR_O)\*.pdb $(DIR_O)\*.res $(EXE) \
$(DIR_BIN)\*.map $(DIR_BIN)\*.exp $(DIR_BIN)\*.pdb \
$(DIR_BIN)\*.ilk
# Define how to build all the objects
{src}.c{$(DIR_O)}.obj::
@$(CXX) $(CXXFLAGS) -c -Fo$(DIR_O)\ $<
{.}.c{$(DIR_O)}.obj::
@$(CXX) $(CXXFLAGS) -c -Fo$(DIR_O)\ $<
$(DIR_O)\cz.res: windows\cz.rc
@$(RC) /nologo -fo$@ $**