comparison druntime/src/compiler/dmd/posix.mak @ 1458:e0b2d67cfe7c

Added druntime (this should be removed once it works).
author Robert Clipsham <robert@octarineparrot.com>
date Tue, 02 Jun 2009 17:43:06 +0100
parents
children
comparison
equal deleted inserted replaced
1456:7b218ec1044f 1458:e0b2d67cfe7c
1 # Makefile to build the compiler runtime D library for Linux
2 # Designed to work with GNU make
3 # Targets:
4 # make
5 # Same as make all
6 # make debug
7 # Build the debug version of the library
8 # make release
9 # Build the release version of the library
10 # make doc
11 # Generate documentation
12 # make clean
13 # Delete all files created by build process
14
15 # Essentials
16
17 LIBDIR=../../../lib
18 DOCDIR=../../../doc
19 IMPDIR=../../../import
20 LIBBASENAME=libdruntime-rt-dmd.a
21 MODULES=
22 BUILDS=debug release unittest
23
24 MODULES_BASE=aaA aApply aApplyR adi alloca arrayassign arraybyte \
25 arraycast arraycat arraydouble arrayfloat arrayint arrayreal \
26 arrayshort cast_ cmath2 cover deh2 dmain2 invariant invariant_ \
27 lifetime llmath memory memset obj object_ qsort switch_ trace
28 # NOTE: trace.o and cover.o are not necessary for a successful build
29 # as both are used for debugging features (profiling and coverage)
30 # NOTE: a pre-compiled minit.obj has been provided in dmd for Win32 and
31 # minit.asm is not used by dmd for Linux
32 # NOTE: deh.o is only needed for Win32, Linux uses deh2.o
33 MODULES_UTIL=$(addprefix util/,console cpuid ctype string utf)
34 MODULES_TI=$(addprefix typeinfo/ti_,AC Acdouble Acfloat Acreal Adouble \
35 Afloat Ag Aint Along Areal Ashort byte C cdouble cfloat char creal \
36 dchar delegate double float idouble ifloat int ireal long ptr real \
37 short ubyte uint ulong ushort void wchar)
38 C_SRCS=complex.c critical.c memory_osx.c monitor.c
39
40 # Symbols
41
42 DMD=dmd
43 DOCFLAGS=-version=DDoc
44 DFLAGS_release=-d -release -O -inline -w -nofloat
45 DFLAGS_debug=-d -g -w -nofloat
46 DFLAGS_unittest=$(DFLAGS_release) -unittest
47 CFLAGS_release=-m32 -O
48 CFLAGS_debug=-m32 -g
49 CFLAGS_unittest=$(CFLAGS_release)
50
51 # Derived symbols
52
53 C_OBJS=$(addsuffix .o,$(basename $(C_SRCS)))
54 AS_OBJS=$(addsuffix .o,$(basename $(AS_SRCS)))
55 ALL_MODULES=$(MODULES_BASE) $(MODULES_UTIL) $(MODULES_TI)
56 D_SRCS=$(addsuffix .d,$(ALL_MODULES))
57 ALLLIBS=$(addsuffix /$(LIBBASENAME),$(addprefix $(LIBDIR)/,$(BUILDS)))
58
59 # Patterns
60
61 $(LIBDIR)/%/$(LIBBASENAME) : $(D_SRCS) $(C_SRCS) $(AS_SRCS)
62 $(CC) -c $(CFLAGS_$*) $(C_SRCS)
63 $(DMD) $(DFLAGS_$*) -lib -of$@ $(D_SRCS) $(C_OBJS) $(AS_OBJS)
64 rm $(C_OBJS) $(AS_OBJS)
65
66 $(DOCDIR)/%.html : %.d
67 $(DMD) -c -d -o- -Df$@ $<
68
69 $(IMPDIR)/%.di : %.d
70 $(DMD) -c -d -o- -Hf$@ $<
71
72 # Rulez
73
74 all : $(BUILDS) doc
75
76 debug : $(LIBDIR)/debug/$(LIBBASENAME) $(IMPORTS)
77 release : $(LIBDIR)/release/$(LIBBASENAME) $(IMPORTS)
78 unittest : $(LIBDIR)/unittest/$(LIBBASENAME) $(IMPORTS)
79 #doc : $(DOCS)
80
81 clean :
82 rm -f $(IMPORTS) $(DOCS) $(ALLLIBS)