Enable limited testing in Makefile.msft without Cygwin
[platform/upstream/libatomic_ops.git] / src / Makefile.msft
1 #
2 # Copyright (c) 2003-2005 Hewlett-Packard Development Company, L.P.
3 #
4 # The really trivial win32/VC++ Makefile.  Note that atomic_ops.c defines
5 # only AO_pause (used by atomic_ops_stack).
6 # And we rely on a pre-built test_atomic_include.h and generalize-small.h,
7 # since we can't rely on sed.  But we don't keep test_atomic_include.h in
8 # the development repository any longer, so if you want to run all tests
9 # for the sources obtained from the repository then
10 # type "./autogen.sh; ./configure; make check; make clean" in Cygwin first.
11 # Otherwise type "nmake -f Makefile.msft check-noautogen" to run only the
12 # tests not requiring the source auto-generation.
13 # Win32 clients only need to include the header files.
14 # To install, copy atomic_ops.h and the atomic_ops/... tree to your favorite
15 # include directory.
16
17 #!include <ntwin32.mak>
18
19 CFLAGS_EXTRA=
20 CFLAGS=-O2 -W3 -DAO_ASSUME_WINDOWS98 $(CFLAGS_EXTRA)
21
22 LIB_OBJS=atomic_ops.obj atomic_ops_malloc.obj atomic_ops_stack.obj
23
24 all: libatomic_ops_gpl.lib
25
26 atomic_ops.obj:
27         cl $(CFLAGS) -c atomic_ops.c
28
29 atomic_ops_stack.obj:
30         cl $(CFLAGS) -c atomic_ops_stack.c
31
32 atomic_ops_malloc.obj:
33         cl $(CFLAGS) -c atomic_ops_malloc.c
34
35 libatomic_ops_gpl.lib: $(LIB_OBJS)
36         lib /out:libatomic_ops_gpl.lib $(LIB_OBJS)
37
38 test_atomic: ..\tests\test_atomic.c ..\tests\test_atomic_include.h
39         cl $(CFLAGS) -I. ..\tests\test_atomic.c /Fo.\test_atomic
40
41 test_atomic_w95: ..\tests\test_atomic.c ..\tests\test_atomic_include.h
42         cl -W3 -O2 -I. ..\tests\test_atomic.c /Fo.\test_atomic_w95
43
44 test_malloc: ..\tests\test_malloc.c libatomic_ops_gpl.lib
45         cl $(CFLAGS) -I. ..\tests\test_malloc.c /Fo.\test_malloc \
46             libatomic_ops_gpl.lib
47
48 test_stack: ..\tests\test_stack.c libatomic_ops_gpl.lib
49         cl $(CFLAGS) -I. ..\tests\test_stack.c /Fo.\test_stack \
50             libatomic_ops_gpl.lib
51
52 check: test_atomic test_atomic_w95 check-noautogen
53         @echo "The following will print lots of 'Missing ...' messages"
54         test_atomic_w95
55         @echo "The following will print some 'Missing ...' messages"
56         test_atomic
57
58 check-noautogen: test_malloc test_stack
59         test_malloc
60         test_stack
61
62 clean:
63         del *.exe *.obj libatomic_ops_gpl.lib