4a3ff31ec9fc35de9661e3e2ae3842b17899359e
[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 do "make check"
9 # for the sources obtained from the repository then
10 # do "autoreconf -vif; ./configure; make check" in Cygwin first.
11 # Win32 clients only need to include the header files.
12 # To install, copy atomic_ops.h and the atomic_ops/... tree to your favorite
13 # include directory.
14
15 #!include <ntwin32.mak>
16
17 CFLAGS_EXTRA=
18 CFLAGS=-O2 -W3 -DAO_ASSUME_WINDOWS98 $(CFLAGS_EXTRA)
19
20 LIB_OBJS=atomic_ops.obj atomic_ops_malloc.obj atomic_ops_stack.obj
21
22 all: libatomic_ops_gpl.lib
23
24 atomic_ops.obj:
25         cl $(CFLAGS) -c atomic_ops.c
26
27 atomic_ops_stack.obj:
28         cl $(CFLAGS) -c atomic_ops_stack.c
29
30 atomic_ops_malloc.obj:
31         cl $(CFLAGS) -c atomic_ops_malloc.c
32
33 libatomic_ops_gpl.lib: $(LIB_OBJS)
34         lib /out:libatomic_ops_gpl.lib $(LIB_OBJS)
35
36 test_atomic: ..\tests\test_atomic.c ..\tests\test_atomic_include.h
37         cl $(CFLAGS) -I. ..\tests\test_atomic.c /Fo.\test_atomic
38
39 test_atomic_w95: ..\tests\test_atomic.c ..\tests\test_atomic_include.h
40         cl -W3 -O2 -I. ..\tests\test_atomic.c /Fo.\test_atomic_w95
41
42 test_malloc: ..\tests\test_malloc.c libatomic_ops_gpl.lib
43         cl $(CFLAGS) -I. ..\tests\test_malloc.c /Fo.\test_malloc \
44             libatomic_ops_gpl.lib
45
46 test_stack: ..\tests\test_stack.c libatomic_ops_gpl.lib
47         cl $(CFLAGS) -I. ..\tests\test_stack.c /Fo.\test_stack \
48             libatomic_ops_gpl.lib
49
50 check: test_atomic test_atomic_w95 test_malloc test_stack
51         @echo "The following will print lots of 'Missing ...' messages"
52         test_atomic_w95
53         @echo "The following will print some 'Missing ...' messages"
54         test_atomic
55         test_malloc
56         test_stack
57
58 clean:
59         del *.exe *.obj libatomic_ops_gpl.lib