1 # -*- Makefile -*- for libsigsegv
3 #### Start of system configuration section. ####
5 # Flags that can be set on the nmake command line:
6 # MFLAGS={-ML|-MT|-MD} for defining the compilation model
7 # MFLAGS=-ML (the default) Single-threaded, statically linked - libc.lib
8 # MFLAGS=-MT Multi-threaded, statically linked - libcmt.lib
9 # MFLAGS=-MD Multi-threaded, dynamically linked - msvcrt.lib
10 # DEBUG=1 for compiling with debugging information
11 # Note that nmake command line flags are automatically passed to subdirectory
12 # Makefiles. Therefore we don't need to pass them explicitly to subdirectory
13 # Makefiles, but the subdirectory Makefiles need to have the same defaults.
14 # Building as a DLL not supported yet.
30 OPTIMFLAGS = -D_NDEBUG -O1
33 # Directories used by "make":
36 # Directories used by "make install":
38 local_prefix = /usr/local
39 exec_prefix = $(prefix)
40 libdir = $(exec_prefix)/lib
41 includedir = $(prefix)/include
43 # Programs used by "make":
45 CFLAGS = $(MFLAGS) $(OPTIMFLAGS)
47 INCLUDES = -I. -I$(srcdir)
55 # Programs used by "make install":
57 INSTALL_PROGRAM = @INSTALL_PROGRAM@
58 INSTALL_DATA = @INSTALL_DATA@
60 #### End of system configuration section. ####
64 OBJECTS = handler.obj dispatcher.obj version.obj
68 config.h : config.h.msvc
69 $(CP) $(srcdir)\config.h.msvc config.h
71 sigsegv.h : src/sigsegv.h.msvc
72 $(CP) $(srcdir)\src\sigsegv.h.msvc sigsegv.h
74 handler.obj : $(srcdir)/src/handler.c $(srcdir)/src/handler-win32.c sigsegv.h config.h
75 $(CC) $(CFLAGS) $(INCLUDES) -c $(srcdir)/src/handler.c
77 dispatcher.obj : $(srcdir)/src/dispatcher.c sigsegv.h config.h
78 $(CC) $(CFLAGS) $(INCLUDES) -c $(srcdir)/src/dispatcher.c
80 version.obj : $(srcdir)/src/version.c sigsegv.h
81 $(CC) $(CFLAGS) $(INCLUDES) -c $(srcdir)/src/version.c
84 sigsegv.lib : $(OBJECTS)
86 $(AR) $(AR_FLAGS)sigsegv.lib $(OBJECTS)
88 # sigsegv.dll and sigsegv.lib are created together.
89 sigsegv.lib : $(OBJECTS)
90 $(CC) $(MFLAGS) -LD $(OBJECTS) -Fesigsegv.dll
93 sigsegv1.exe : $(srcdir)/tests/sigsegv1.c sigsegv.h sigsegv.lib
94 $(CC) $(CFLAGS) $(INCLUDES) $(srcdir)/tests/sigsegv1.c sigsegv.lib /Fesigsegv1
96 sigsegv2.exe : $(srcdir)/tests/sigsegv2.c sigsegv.h sigsegv.lib
97 $(CC) $(CFLAGS) $(INCLUDES) $(srcdir)/tests/sigsegv2.c sigsegv.lib /Fesigsegv2
99 stackoverflow1.exe : $(srcdir)/tests/stackoverflow1.c sigsegv.h sigsegv.lib
100 $(CC) $(CFLAGS) $(INCLUDES) $(srcdir)/tests/stackoverflow1.c sigsegv.lib /Festackoverflow1
102 stackoverflow2.exe : $(srcdir)/tests/stackoverflow2.c sigsegv.h sigsegv.lib
103 $(CC) $(CFLAGS) $(INCLUDES) $(srcdir)/tests/stackoverflow2.c sigsegv.lib /Festackoverflow2
105 check : all sigsegv1.exe sigsegv2.exe stackoverflow1.exe stackoverflow2.exe
114 $(RM) sigsegv.h *.obj *.lib *.exp *.dll core
115 $(RM) sigsegv1.exe sigsegv2.exe stackoverflow1.exe stackoverflow2.exe
118 $(RM) config.status config.log config.cache Makefile config.h
120 maintainer-clean : distclean