1 # Makefile for VC++ compiler (modified from original Makefile.in)
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004 Free Software Foundation, Inc.
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 ###########################
15 # Configuration variables #
16 ###########################
18 INSTALLDIR = D:\Software\XCircuit-tcl-dev
23 # Possible values: tcl, win32
26 # Additional settings for win32 build
31 # Additional settings for tcl build
32 TCLDIR = D:\Software\Tcl
35 ####################################################################
36 # End of configuration. DO NOT CHANGE ANYTHING AFTER THIS POINT!!! #
37 ####################################################################
39 SOURCES = menudep.c $(xcircuit_SOURCES)
41 MAKE = $(MAKE) -f Makefile.win32
48 menudep_SOURCES = menudep.c
49 menudep_OBJECTS = menudep.$(OBJEXT)
50 menudep_LDADD = $(LDADD)
51 xcircuit_OBJECTS = elements.$(OBJEXT) events.$(OBJEXT) \
52 filelist.$(OBJEXT) files.$(OBJEXT) flate.$(OBJEXT) \
53 fontfile.$(OBJEXT) formats.$(OBJEXT) functions.$(OBJEXT) \
54 graphic.$(OBJEXT) help.$(OBJEXT) keybindings.$(OBJEXT) \
55 libraries.$(OBJEXT) menucalls.$(OBJEXT) netlist.$(OBJEXT) \
56 ngspice.$(OBJEXT) opengl.$(OBJEXT) parameter.$(OBJEXT) \
57 python.$(OBJEXT) rcfile.$(OBJEXT) render.$(OBJEXT) \
58 schema.$(OBJEXT) selection.$(OBJEXT) text.$(OBJEXT) \
59 undo.$(OBJEXT) xcircuit.$(OBJEXT) $(WIN32_OBJECTS)
60 DEFAULT_INCLUDES = -I. -I$(srcdir)
61 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
64 LINK = $(CCLD) $(CFLAGS) $(LDFLAGS) -Fe$@
65 SOURCES = menudep.c $(xcircuit_SOURCES)
66 DIST_SOURCES = menudep.c $(xcircuit_SOURCES)
69 DIST_SUBDIRS = $(SUBDIRS)
70 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
71 distdir = $(PACKAGE)-$(VERSION)
72 top_distdir = $(distdir)
73 DIST_ARCHIVES = $(distdir).zip
80 !if "$(BUILD_TYPE)" == "win32"
81 WIN32_OBJECTS = xcwin32.$(OBJEXT) xtfuncs.$(OBJEXT) xtgui.$(OBJEXT) resources.res
82 BUILTINS_DIR = WinBuiltinsDir()
83 STARTUP_FILE = startup.script
84 XC_CFLAGS = -DHAVE_XPM -D_CRT_SECURE_NO_DEPRECATE
85 !if "$(USE_WIN32_COM)" != "0"
86 XC_CFLAGS = $(XC_CFLAGS) -DUSE_WIN32_COM
87 XC_DEPEND = $(XCCOMDIR)\XCCom.lib
88 XC_LIBS = $(XCCOMDIR)\XCCom.lib ole32.lib oleaut32.lib
89 !if "$(USE_WIN32_DOTNET)" != "0"
90 XC_CFLAGS = $(XC_CFLAGS) -DUSE_WIN32_DOTNET
94 WIN32_OBJECTS = tclxcircuit.$(OBJEXT) tkSimple.$(OBJEXT) w32x11.$(OBJEXT)
95 BUILTINS_DIR = \"$(librarydir:\=/)\"
96 SCRIPTS_DIR = \"$(scriptsdir:\=/)\"
97 STARTUP_FILE = xcstartup.tcl
98 XC_CFLAGS = -DTCL_WRAPPER -D_CRT_SECURE_NO_DEPRECATE
99 XC_INCLUDES = -I$(TCLDIR)\include
100 XC_LIBS = $(TCLDIR)\lib\tcl$(TCLVERSION).lib $(TCLDIR)\lib\tk$(TCLVERSION).lib
104 # Override standard "make" target when compiling under TCL
105 ALL_TARGET = all-recursive
106 INSTALL_TARGET = install
109 CFLAGS = -Zi -DSPICE_EXEC=\"$(SPICE_EXEC:\=/)\" -DHAVE_PUTENV -DGS_EXEC=\"$(GS_EXEC:\=/)\" -DXC_WIN32 -DDOUBLEBUFFER $(XC_CFLAGS)
115 # Main compiler arguments
123 GS_EXEC = $(GSDIR)\bin\gswin32c.exe
124 INC_SPECS = -I. $(XC_INCLUDES)
125 INSTALL_DATA = copy /y
126 INSTALL_PROGRAM = copy /y
127 INSTALL_SCRIPT = copy /y
128 INSTALL_STRIP_PROGRAM = copy /y
133 LIBS = ws2_32.lib gdi32.lib user32.lib kernel32.lib comdlg32.lib comctl32.lib $(XC_LIBS)
134 # imm32.lib shell32.lib comctl32.lib advapi32.lib
143 PACKAGE_NAME = xcircuit
148 SHLIB_CFLAGS = /LD /ML
150 SPICE_EXEC = ngspice.exe
152 TCL_LIB_DIR = $(TCLDIR)\lib
153 WISH_EXE = $(TCLDIR)\bin\wish$(TCLVERSION).exe
155 XCIRCUIT_TARGET = $(BUILD_TYPE)
157 prefix = $(INSTALLDIR)
158 bindir = $(prefix)\bin
160 exec_prefix = $(prefix)\bin
161 includedir = $(prefix)\include
162 libdir = $(prefix)\lib
163 libexecdir = $(prefix)\bin
164 mandir = $(prefix)\doc
167 # Temporary directory (if not overridden by environment variable TMPDIR)
170 # Directories for app-defaults file and manual page
171 PATHNAMES = -DPROG_VERSION=$(VERSION) \
172 -DPROG_REVISION=$(REVISION) \
173 -DCAD_DIR=\"$(prefix:\=/)\" \
174 -DTEMP_DIR=\"$(tmpdir:\=/)\" \
175 -DBUILTINS_DIR=$(BUILTINS_DIR) \
176 -DBUILTINS_FILE=\"$(BUILTINS_FILE)\" \
177 -DUSER_RC_FILE=\"$(USER_RC_FILE)\" \
178 -DPROLOGUE_DIR=$(BUILTINS_DIR) \
179 -DPROLOGUE_FILE=\"$(PROLOGUE_FILE)\" \
180 -DSTARTUP_FILE=\"$(STARTUP_FILE)\" \
181 -DLGF_LIB=\"$(LGF_LIB)\"
183 xcircuit_SOURCES = elements.c events.c filelist.c files.c \
184 flate.c fontfile.c formats.c functions.c graphic.c \
185 help.c keybindings.c libraries.c menucalls.c \
186 netlist.c ngspice.c opengl.c parameter.c python.c \
187 rcfile.c render.c schema.c selection.c text.c undo.c \
188 tclxcircuit.c tkSimple.c xcircuit.c w32x11.c
190 xcircuit_DEPEND = $(XC_DEPEND)
192 man_MANS = lib/xcircuit.1
193 INCLUDES = $(INC_SPECS)
195 # Library directory and files
196 librarydir = $(datadir)\$(PACKAGE)-$(VERSION)
197 scriptsdir = $(datadir)\$(PACKAGE)-$(VERSION)
198 USER_RC_FILE = .xcircuitrc
199 PROLOGUE_FILE = xcircps2.pro
201 SIGNAL_LIB = signal.lps
202 MUSIC_LIB = musiclib.lps
203 FONTS_LPS = courier courieriso2 courieriso5 helvetica helveticaiso2 \
204 helveticaiso5 myfont symbol times_roman times_romaniso2 \
207 FONTS_XFE = courier courieriso courieriso2 courieriso5 helvetica \
208 helveticaiso helveticaiso2 helveticaiso5 myfont symbol \
209 times_roman times_romaniso times_romaniso2 times_romaniso5
211 SCRIPTS_PY = spice gettext pagebbox
212 WRAPPER_INIT = xcircuit.tcl
213 WRAPPER_OBJ = xcircuit$(SHDLIB_EXT)
214 WRAPPER_SO = xcircuit.dll
215 WRAPPER_SH = xcircuit.bat
217 CONSOLE_SCRIPT = console.tcl
222 .SUFFIXES: .c .o .obj .rc .res
231 rc -fo$@ $(XC_CFLAGS) /i$(XCCOMDIR) $<
237 menudep$(EXEEXT): menudep.$(OBJEXT)
240 menudep.h: menudep$(EXEEXT) menus.h
243 xcwrap.obj: xcwrap.c menudep.h
244 $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(PATHNAMES) $(INCLUDES) \
245 xcwrap.c -c -Foxcwrap.$(OBJEXT)
247 lib\tcl\xcircuit$(SHDLIB_EXT): xcwrap.$(OBJEXT) $(xcircuit_OBJECTS) $(xcircuit_DEPEND)
248 -$(RM) lib\xcircuit$(SHDLIB_EXT)
249 $(CC) $(CFLAGS) $(SHLIB_CFLAGS) -Fe$@ $(LDDL_FLAGS) xcwrap.$(OBJEXT) \
250 $(xcircuit_OBJECTS) $(xcircuit_LDADD) $(LDFLAGS) \
251 $(X_EXTRA_LIBS) $(EXTRA_LIBS) $(LIBS) $(EXTRA_LIB_SPECS) \
254 xcircuit$(EXEEXT): $(xcircuit_OBJECTS) $(xcircuit_DEPEND)
255 $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(INCLUDES) $(xcircuit_OBJECTS) \
256 -Fe$@ $(LDFLAGS) $(LIBS) $(LIB_SPECS) $(EXTRA_LIB_SPECS) shell32.lib \
257 /link /SUBSYSTEM:CONSOLE
259 xcircexec$(EXEEXT): xcircexec.$(OBJEXT)
260 -$(RM) .\xcircexec$(EXEEXT)
261 $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(PATHNAMES) $(INCLUDES) \
262 xcircexec.c -Fe$@ $(LDFLAGS) \
263 $(LIBS) $(LIB_SPECS) $(EXTRA_LIB_SPECS)
265 xcircuit-win32$(EXEEXT): xcircuit-win32.c resources.res
266 $(CC) $(CFLAGS) $(CPPFLAGS) \
267 -DWISH_EXE=L\"$(WISH_EXE:\=/)\" \
268 -DBUILTINS_DIR=L$(BUILTINS_DIR) \
269 $(INCLUDES) xcircuit-win32.c resources.res \
270 -Fe$@ $(LDFLAGS) $(LIBS) $(LIB_SPECS) $(EXTRA_LIB_SPECS) shell32.lib advapi32.lib
273 @echo Making tcl library object
274 $(MAKE) lib\tcl\xcircuit$(SHDLIB_EXT)
275 $(MAKE) lib\$(INTERP_PATH)\$(WRAPPER_SH)
276 $(MAKE) lib\$(INTERP_PATH)\$(WRAPPER_INIT)
277 $(MAKE) xcircexec$(EXEEXT)
278 $(MAKE) xcircuit-win32$(EXEEXT)
282 !if "$(USE_WIN32_COM)" != "0"
283 cd $(XCCOMDIR) && $(MAKE) && cd ..
285 $(MAKE) xcircuit$(EXEEXT)
288 menucalls.c: menudep.h
291 xcircuit.c: menudep.h
292 parameter.c: menudep.h
294 tclxcircuit.c: menudep.h
295 resources.rc: lib/pixmaps/xcircuit.ico
300 lib\$(INTERP_PATH)\$(WRAPPER_SH): $(PP) lib\$(INTERP_PATH)\$(WRAPPER_SH).in
301 $(PP) $(PATHNAMES) -DXCLIBDIR=\"$(librarydir:\=/)\" \
302 -DWRAPPER_INIT=\"$(WRAPPER_INIT)\" -DCONSOLE=\"$(CONSOLE)\" \
303 -DCONSOLE_SCRIPT=\"$(CONSOLE_SCRIPT)\" \
304 -DTCLLIBDIR=\"$(TCL_LIB_DIR:\=/)\" \
305 -DWISH_EXE=\"$(WISH_EXE:\=/)\" \
306 lib/$(INTERP_PATH)/$(WRAPPER_SH).in > $@
308 lib\$(INTERP_PATH)\$(WRAPPER_INIT): $(PP) lib\$(INTERP_PATH)\$(WRAPPER_INIT).in
309 $(PP) $(PATHNAMES) -DLIBDIR=\"$(librarydir:\=/)\" \
310 lib/$(INTERP_PATH)/$(WRAPPER_INIT).in > $@
312 lib\xcircuit.1: $(PP) lib\xcircuit.1.in
313 $(PP) -DLIBDIR=\"$(libdir)\" \
314 -DSCRIPTSDIR=\"$(scriptsdir)\" \
315 -DLGF=1 -DPYTHON=0 -DTCL=1 -DNOINTERP=0 \
316 lib\xcircuit.1.in > $@
318 install-data-local: lib/xcircuit.1
319 @echo "Installing library files"
320 $(mkinstalldirs) $(DESTDIR)$(librarydir)
322 for %i in ($(PROLOGUE_FILE) *.lps) do $(INSTALL_DATA) %i $(DESTDIR)$(librarydir)
324 cd lib\$(INTERP_PATH)
325 for %i in ($(STARTUP_FILE)) do $(INSTALL_DATA) %i $(DESTDIR)$(librarydir)
327 @echo "Installing .lps font files"
328 $(mkinstalldirs) $(DESTDIR)$(librarydir)\fonts
329 for %i in ($(FONTS_LPS)) do $(INSTALL_DATA) lib\fonts\%i.lps $(DESTDIR)$(librarydir)\fonts
330 @echo "Installing .xfe font files"
331 for %i in ($(FONTS_XFE)) do $(INSTALL_DATA) lib\fonts\%i.xfe $(DESTDIR)$(librarydir)\fonts
332 @echo "Installing scripts (if option enabled)"
334 # Note that MacOS/Fink uses SHDLIB_EXT = .dylib but Tcl expects .so anyway.
335 # So we make a symbolic link if SHDLIB_EXT != .so
337 install-tcl: xcircexec$(EXEEXT) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_PATH)/$(WRAPPER_SH) lib/$(INTERP_PATH)/$(WRAPPER_INIT) xcircuit-win32$(EXEEXT)
338 if exist $(prefix) $(RMDIR) $(prefix)
339 @echo "Installing standard XCircuit library files"
340 $(MAKE) $(AM_MAKEFLAGS) install-data-local
341 @echo "Installing Tcl files"
342 cd lib\$(INTERP_PATH)
343 for %i in ($(WRAPPER_OBJ) *.tcl) do $(INSTALL_DATA) %i $(DESTDIR)$(librarydir)
345 $(INSTALL_DATA) xcircexec$(EXEEXT) $(DESTDIR)$(librarydir)
346 @echo "Installing pixmap images"
347 $(mkinstalldirs) $(DESTDIR)$(librarydir)\pixmaps
349 for %i in (*.gif *.xbm) do $(INSTALL_DATA) %i $(DESTDIR)$(librarydir)\pixmaps
351 @echo "Installing shell script as xcircuit executable"
352 $(mkinstalldirs) $(DESTDIR)$(bindir)
353 $(INSTALL_DATA) lib\$(INTERP_PATH)\$(WRAPPER_SH) $(DESTDIR)$(bindir)
354 $(INSTALL_DATA) xcircuit-win32$(EXEEXT) $(DESTDIR)$(bindir)
356 install-win32: xcircuit$(EXEEXT)
357 if exist $(prefix) $(RMDIR) $(prefix)
358 $(MAKE) $(AM_MAKEFLAGS) install-data-local "librarydir=$(prefix)"
359 $(INSTALL_DATA) xcircuit$(EXEEXT) $(DESTDIR)$(prefix)
362 -$(RM) lib\$(INTERP_PATH)\$(WRAPPER_OBJ) lib\$(INTERP_PATH)\$(WRAPPER_SH)
363 -for %e in (ilk exp pdb lib) do @if exist lib\$(INTERP_PATH)\xcircuit.%e $(RM) lib\$(INTERP_PATH)\xcircuit.%e
364 -$(RM) lib\$(INTERP_PATH)\$(WRAPPER_INIT)
365 -for %f in (*.$(OBJEXT) xcircexec$(EXEEXT) lib\xcircuit.1 xcircuit$(EXEEXT) xcircuit.suo) do $(RM) %f
366 -for %e in (aps res) do $(RM) resources.%e
367 -for %e in (ilk exp pdb lib) do @if exist xcircexec.%e $(RM) xcircexec.%e
368 -for %e in (ilk exp pdb lib) do @if exist xcircuit.%e $(RM) xcircuit.%e
369 -for %e in (ilk exp pdb lib) do @if exist pp.%e $(RM) pp.%e
370 -for %e in (ilk exp pdb lib exe) do @if exist xcircuit-win32.%e $(RM) xcircuit-win32.%e
371 -$(RM) menudep$(EXEEXT) menudep.h
375 !if "$(BUILD_TYPE)" == "win32" && "$(USE_WIN32_COM)" != "0"
376 cd $(XCCOMDIR) && $(MAKE) clean && cd ..
380 $(MAKE) $(XCIRCUIT_TARGET)
386 !if "$(BUILD_TYPE)" == "win32" && "$(USE_WIN32_COM)" != "0"
387 cd $(XCCOMDIR) && $(MAKE) examples && cd ..
390 !if "$(BUILD_TYPE)" == "win32"
391 xcircuit.h: xcwin32.h
392 xcwin32.c: xcircuit.h
394 xcircuit.h: tkwin32.h
396 elements.c: xcircuit.h
398 filelist.c: xcircuit.h
401 fontfile.c: xcircuit.h
402 formats.c: xcircuit.h
403 functions.c: xcircuit.h
404 graphic.c: xcircuit.h
406 keybindings.c: xcircuit.h
407 libraries.c: xcircuit.h
408 menucalls.c: xcircuit.h
409 netlist.c: xcircuit.h
410 ngspice.c: xcircuit.h
412 parameter.c: xcircuit.h
417 selection.c: xcircuit.h
420 xcircuit.c: xcircuit.h
422 xtfuncs.c: xcircuit.h
423 !if "$(BUILD_TYPE)" == "win32" && "$(USE_WIN32_COM)" != "0"
424 resources.rc: $(XCCOMDIR)/XCCom.tlb