mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-17 17:29:02 +02:00
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Reworked the LLVMDC specific pragmas.
This commit is contained in:
154
runtime/lib/common/tango/llvmdc.mak
Normal file
154
runtime/lib/common/tango/llvmdc.mak
Normal file
@@ -0,0 +1,154 @@
|
||||
# Makefile to build the common D runtime library for LLVM
|
||||
# Designed to work with GNU make
|
||||
# Targets:
|
||||
# make
|
||||
# Same as make all
|
||||
# make lib
|
||||
# Build the common library
|
||||
# make doc
|
||||
# Generate documentation
|
||||
# make clean
|
||||
# Delete unneeded files created by build process
|
||||
|
||||
LIB_TARGET=libtango-cc-tango.a
|
||||
LIB_MASK=libtango-cc-tango*.a
|
||||
LIB_TARGET_C=libtango-cc-c-tango.a
|
||||
LIB_MASK_C=libtango-cc-c-tango*.a
|
||||
|
||||
CP=cp -f
|
||||
RM=rm -f
|
||||
MD=mkdir -p
|
||||
|
||||
ADD_CFLAGS=
|
||||
ADD_DFLAGS=
|
||||
|
||||
#CFLAGS=-O3 $(ADD_CFLAGS)
|
||||
CFLAGS=-g $(ADD_CFLAGS)
|
||||
|
||||
#DFLAGS=-release -O3 -inline -w $(ADD_DFLAGS)
|
||||
DFLAGS=-g -w -noasm $(ADD_DFLAGS)
|
||||
|
||||
#TFLAGS=-O3 -inline -w $(ADD_DFLAGS)
|
||||
TFLAGS=-g -w -noasm $(ADD_DFLAGS)
|
||||
|
||||
DOCFLAGS=-version=DDoc
|
||||
|
||||
CC=gcc
|
||||
LC=llvm-ar rsv
|
||||
CLC=ar rsv
|
||||
DC=llvmdc
|
||||
LLC=llvm-as
|
||||
|
||||
INC_DEST=../../../tango
|
||||
LIB_DEST=..
|
||||
DOC_DEST=../../../doc/tango
|
||||
|
||||
.SUFFIXES: .s .S .c .cpp .d .ll .html .o .bc
|
||||
|
||||
.s.o:
|
||||
$(CC) -c $(CFLAGS) $< -o$@
|
||||
|
||||
.S.o:
|
||||
$(CC) -c $(CFLAGS) $< -o$@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $< -o$@
|
||||
|
||||
.cpp.o:
|
||||
g++ -c $(CFLAGS) $< -o$@
|
||||
|
||||
.d.bc:
|
||||
$(DC) -c $(DFLAGS) -Hf$*.di $< -of$@
|
||||
# $(DC) -c $(DFLAGS) $< -of$@
|
||||
|
||||
.ll.bc:
|
||||
$(LLC) -f -o=$@ $<
|
||||
|
||||
.d.html:
|
||||
$(DC) -c -o- $(DOCFLAGS) -Df$*.html $<
|
||||
# $(DC) -c -o- $(DOCFLAGS) -Df$*.html tango.ddoc $<
|
||||
|
||||
targets : lib doc
|
||||
all : lib doc
|
||||
tango : lib
|
||||
lib : tango.lib tango.clib
|
||||
doc : tango.doc
|
||||
|
||||
######################################################
|
||||
|
||||
OBJ_CORE= \
|
||||
core/BitManip.bc \
|
||||
core/Exception.bc \
|
||||
core/Memory.bc \
|
||||
core/Runtime.bc \
|
||||
core/Thread.bc
|
||||
# core/ThreadASM.o
|
||||
|
||||
OBJ_STDC= \
|
||||
stdc/wrap.o
|
||||
# stdc/wrap.bc
|
||||
|
||||
OBJ_STDC_POSIX= \
|
||||
stdc/posix/pthread_darwin.o
|
||||
|
||||
ALL_OBJS= \
|
||||
$(OBJ_CORE)
|
||||
# $(OBJ_STDC)
|
||||
# $(OBJ_STDC_POSIX)
|
||||
|
||||
######################################################
|
||||
|
||||
DOC_CORE= \
|
||||
core/BitManip.html \
|
||||
core/Exception.html \
|
||||
core/Memory.html \
|
||||
core/Runtime.html \
|
||||
core/Thread.html
|
||||
|
||||
|
||||
ALL_DOCS=
|
||||
|
||||
######################################################
|
||||
|
||||
tango.lib : $(LIB_TARGET)
|
||||
|
||||
$(LIB_TARGET) : $(ALL_OBJS)
|
||||
$(RM) $@
|
||||
$(LC) $@ $(ALL_OBJS)
|
||||
|
||||
|
||||
tango.clib : $(LIB_TARGET_C)
|
||||
|
||||
$(LIB_TARGET_C) : $(OBJ_STDC)
|
||||
$(RM) $@
|
||||
$(CLC) $@ $(OBJ_STDC)
|
||||
|
||||
|
||||
tango.doc : $(ALL_DOCS)
|
||||
echo Documentation generated.
|
||||
|
||||
######################################################
|
||||
|
||||
### stdc/posix
|
||||
|
||||
#stdc/posix/pthread_darwin.o : stdc/posix/pthread_darwin.d
|
||||
# $(DC) -c $(DFLAGS) stdc/posix/pthread_darwin.d -of$@
|
||||
|
||||
######################################################
|
||||
|
||||
clean :
|
||||
find . -name "*.di" | xargs $(RM)
|
||||
$(RM) $(ALL_OBJS)
|
||||
$(RM) $(OBJ_STDC)
|
||||
$(RM) $(ALL_DOCS)
|
||||
find . -name "$(LIB_MASK)" | xargs $(RM)
|
||||
find . -name "$(LIB_MASK_C)" | xargs $(RM)
|
||||
|
||||
install :
|
||||
$(MD) $(INC_DEST)
|
||||
find . -name "*.di" -exec cp -f {} $(INC_DEST)/{} \;
|
||||
$(MD) $(DOC_DEST)
|
||||
find . -name "*.html" -exec cp -f {} $(DOC_DEST)/{} \;
|
||||
$(MD) $(LIB_DEST)
|
||||
find . -name "$(LIB_MASK)" -exec cp -f {} $(LIB_DEST)/{} \;
|
||||
find . -name "$(LIB_MASK_C)" -exec cp -f {} $(LIB_DEST)/{} \;
|
||||
100
runtime/lib/gc/basic/llvmdc.mak
Normal file
100
runtime/lib/gc/basic/llvmdc.mak
Normal file
@@ -0,0 +1,100 @@
|
||||
# Makefile to build the garbage collector D library for LLVMDC
|
||||
# Designed to work with GNU make
|
||||
# Targets:
|
||||
# make
|
||||
# Same as make all
|
||||
# make lib
|
||||
# Build the garbage collector library
|
||||
# make doc
|
||||
# Generate documentation
|
||||
# make clean
|
||||
# Delete unneeded files created by build process
|
||||
|
||||
LIB_TARGET=libtango-gc-basic.a
|
||||
LIB_MASK=libtango-gc-basic*.a
|
||||
|
||||
CP=cp -f
|
||||
RM=rm -f
|
||||
MD=mkdir -p
|
||||
|
||||
ADD_CFLAGS=
|
||||
ADD_DFLAGS=
|
||||
|
||||
#CFLAGS=-O3 $(ADD_CFLAGS)
|
||||
CFLAGS=-g $(ADD_CFLAGS)
|
||||
|
||||
#DFLAGS=-release -O3 -inline -w -nofloat $(ADD_DFLAGS)
|
||||
DFLAGS=-g -w -nofloat $(ADD_DFLAGS)
|
||||
|
||||
#TFLAGS=-O3 -inline -w -nofloat $(ADD_DFLAGS)
|
||||
TFLAGS=-g -w -nofloat $(ADD_DFLAGS)
|
||||
|
||||
DOCFLAGS=-version=DDoc
|
||||
|
||||
CC=gcc
|
||||
LC=llvm-ar rsv
|
||||
DC=llvmdc
|
||||
|
||||
LIB_DEST=..
|
||||
|
||||
.SUFFIXES: .s .S .c .cpp .d .html .o .bc
|
||||
|
||||
.s.o:
|
||||
$(CC) -c $(CFLAGS) $< -o$@
|
||||
|
||||
.S.o:
|
||||
$(CC) -c $(CFLAGS) $< -o$@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $< -o$@
|
||||
|
||||
.cpp.o:
|
||||
g++ -c $(CFLAGS) $< -o$@
|
||||
|
||||
.d.bc:
|
||||
$(DC) -c $(DFLAGS) $< -of$@
|
||||
|
||||
.d.html:
|
||||
$(DC) -c -o- $(DOCFLAGS) -Df$*.html $<
|
||||
# $(DC) -c -o- $(DOCFLAGS) -Df$*.html dmd.ddoc $<
|
||||
|
||||
targets : lib doc
|
||||
all : lib doc
|
||||
lib : basic.lib
|
||||
doc : basic.doc
|
||||
|
||||
######################################################
|
||||
|
||||
ALL_OBJS= \
|
||||
gc.bc \
|
||||
gcalloc.bc \
|
||||
gcbits.bc \
|
||||
gcstats.bc \
|
||||
gcx.bc
|
||||
|
||||
######################################################
|
||||
|
||||
ALL_DOCS=
|
||||
|
||||
######################################################
|
||||
|
||||
basic.lib : $(LIB_TARGET)
|
||||
|
||||
$(LIB_TARGET) : $(ALL_OBJS)
|
||||
$(RM) $@
|
||||
$(LC) $@ $(ALL_OBJS)
|
||||
|
||||
basic.doc : $(ALL_DOCS)
|
||||
echo No documentation available.
|
||||
|
||||
######################################################
|
||||
|
||||
clean :
|
||||
find . -name "*.di" | xargs $(RM)
|
||||
$(RM) $(ALL_OBJS)
|
||||
$(RM) $(ALL_DOCS)
|
||||
$(RM) $(LIB_MASK)
|
||||
|
||||
install :
|
||||
$(MD) $(LIB_DEST)
|
||||
$(CP) $(LIB_MASK) $(LIB_DEST)/.
|
||||
96
runtime/lib/gc/stub/llvmdc.mak
Normal file
96
runtime/lib/gc/stub/llvmdc.mak
Normal file
@@ -0,0 +1,96 @@
|
||||
# Makefile to build the garbage collector D library for Posix
|
||||
# Designed to work with GNU make
|
||||
# Targets:
|
||||
# make
|
||||
# Same as make all
|
||||
# make lib
|
||||
# Build the garbage collector library
|
||||
# make doc
|
||||
# Generate documentation
|
||||
# make clean
|
||||
# Delete unneeded files created by build process
|
||||
|
||||
LIB_TARGET=libtango-gc-stub.a
|
||||
LIB_MASK=libtango-gc-stub*.a
|
||||
|
||||
CP=cp -f
|
||||
RM=rm -f
|
||||
MD=mkdir -p
|
||||
|
||||
ADD_CFLAGS=
|
||||
ADD_DFLAGS=
|
||||
|
||||
#CFLAGS=-O3 $(ADD_CFLAGS)
|
||||
CFLAGS=-g $(ADD_CFLAGS)
|
||||
|
||||
#DFLAGS=-release -O3 -inline -w $(ADD_DFLAGS)
|
||||
DFLAGS=-g $(ADD_DFLAGS)
|
||||
|
||||
#TFLAGS=-O3 -inline $(ADD_DFLAGS)
|
||||
TFLAGS=-g $(ADD_DFLAGS)
|
||||
|
||||
DOCFLAGS=-version=DDoc
|
||||
|
||||
CC=gcc
|
||||
LC=llvm-ar rsv
|
||||
DC=llvmdc
|
||||
|
||||
LIB_DEST=..
|
||||
|
||||
.SUFFIXES: .s .S .c .cpp .d .html .o .bc
|
||||
|
||||
.s.o:
|
||||
$(CC) -c $(CFLAGS) $< -o$@
|
||||
|
||||
.S.o:
|
||||
$(CC) -c $(CFLAGS) $< -o$@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $< -o$@
|
||||
|
||||
.cpp.o:
|
||||
g++ -c $(CFLAGS) $< -o$@
|
||||
|
||||
.d.bc:
|
||||
$(DC) -c $(DFLAGS) $< -of$@
|
||||
|
||||
.d.html:
|
||||
$(DC) -c -o- $(DOCFLAGS) -Df$*.html $<
|
||||
# $(DC) -c -o- $(DOCFLAGS) -Df$*.html dmd.ddoc $<
|
||||
|
||||
targets : lib doc
|
||||
all : lib doc
|
||||
lib : stub.lib
|
||||
doc : stub.doc
|
||||
|
||||
######################################################
|
||||
|
||||
ALL_OBJS= \
|
||||
gc.bc
|
||||
|
||||
######################################################
|
||||
|
||||
ALL_DOCS=
|
||||
|
||||
######################################################
|
||||
|
||||
stub.lib : $(LIB_TARGET)
|
||||
|
||||
$(LIB_TARGET) : $(ALL_OBJS)
|
||||
$(RM) $@
|
||||
$(LC) $@ $(ALL_OBJS)
|
||||
|
||||
stub.doc : $(ALL_DOCS)
|
||||
echo No documentation available.
|
||||
|
||||
######################################################
|
||||
|
||||
clean :
|
||||
find . -name "*.di" | xargs $(RM)
|
||||
$(RM) $(ALL_OBJS)
|
||||
$(RM) $(ALL_DOCS)
|
||||
$(RM) $(LIB_MASK)
|
||||
|
||||
install :
|
||||
$(MD) $(LIB_DEST)
|
||||
$(CP) $(LIB_MASK) $(LIB_DEST)/.
|
||||
104
runtime/lib/llvmdc-posix.mak
Normal file
104
runtime/lib/llvmdc-posix.mak
Normal file
@@ -0,0 +1,104 @@
|
||||
# Makefile to build the composite D runtime library for Linux
|
||||
# Designed to work with GNU make
|
||||
# Targets:
|
||||
# make
|
||||
# Same as make all
|
||||
# make lib
|
||||
# Build the runtime library
|
||||
# make doc
|
||||
# Generate documentation
|
||||
# make clean
|
||||
# Delete unneeded files created by build process
|
||||
|
||||
LIB_TARGET=libtango-base-llvmdc.a
|
||||
LIB_MASK=libtango-base-llvmdc*.a
|
||||
LIB_TARGET_C=libtango-base-c-llvmdc.a
|
||||
LIB_MASK_C=libtango-base-c-llvmdc*.a
|
||||
LIB_NAME_NATIVE=libtango-base-llvmdc-native
|
||||
LIB_TARGET_NATIVE=$(LIB_NAME_NATIVE).a
|
||||
|
||||
DIR_CC=./common/tango
|
||||
DIR_RT=../../runtime/internal
|
||||
DIR_GC=./gc/basic
|
||||
#DIR_GC=./gc/stub
|
||||
|
||||
CP=cp -f
|
||||
RM=rm -f
|
||||
MD=mkdir -p
|
||||
|
||||
CC=gcc
|
||||
LC=llvm-ar rsv
|
||||
CLC=ar rsv
|
||||
DC=llvmdc
|
||||
LLVMLINK=llvm-link
|
||||
LLC=llc
|
||||
|
||||
ADD_CFLAGS=
|
||||
#ADD_DFLAGS=
|
||||
ADD_DFLAGS=-I`pwd`/common -I`pwd`/.. -I`pwd`/compiler/llvmdc
|
||||
|
||||
targets : nativelib doc
|
||||
all : nativelib lib doc
|
||||
|
||||
######################################################
|
||||
|
||||
ALL_OBJS=
|
||||
|
||||
######################################################
|
||||
|
||||
ALL_DOCS=
|
||||
|
||||
######################################################
|
||||
|
||||
lib : $(ALL_OBJS)
|
||||
make -C $(DIR_CC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
|
||||
make -C $(DIR_RT) -fllvmdc.mak lib
|
||||
make -C $(DIR_GC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
|
||||
find . -name $(LIB_MASK) | xargs $(RM)
|
||||
$(LC) $(LIB_TARGET) `find $(DIR_CC) -name "*.bc" | xargs echo`
|
||||
$(LC) $(LIB_TARGET) `find $(DIR_RT) -name "*.bc" | xargs echo`
|
||||
$(LC) $(LIB_TARGET) `find $(DIR_GC) -name "*.bc" | xargs echo`
|
||||
$(CLC) $(LIB_TARGET_C) `find $(DIR_CC) -name "*.o" | xargs echo`
|
||||
$(CLC) $(LIB_TARGET_C) `find $(DIR_RT) -name "*.o" | xargs echo`
|
||||
|
||||
nativelib: $(ALL_OBJS)
|
||||
make -C $(DIR_CC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
|
||||
make -C $(DIR_RT) -fllvmdc.mak lib
|
||||
make -C $(DIR_GC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
|
||||
|
||||
$(RM) $(LIB_NAME_NATIVE)*
|
||||
|
||||
# first link all bcs together to a single bitcode file
|
||||
$(LLVMLINK) -o=$(LIB_NAME_NATIVE)-llvm.bc `find $(DIR_CC) $(DIR_RT) $(DIR_GC) -name "*.bc"`
|
||||
# then compile to assembler
|
||||
$(LLC) -o=$(LIB_NAME_NATIVE)-llvm.s $(LIB_NAME_NATIVE)-llvm.bc
|
||||
# assemble native code
|
||||
$(CC) -c -o $(LIB_NAME_NATIVE)-llvm.o $(LIB_NAME_NATIVE)-llvm.s
|
||||
# make an archive containing it and the other native object files
|
||||
$(CLC) $(LIB_TARGET_NATIVE) $(LIB_NAME_NATIVE)-llvm.o `find $(DIR_CC) $(DIR_RT) -name "*.o"`
|
||||
|
||||
|
||||
doc : $(ALL_DOCS)
|
||||
make -C $(DIR_CC) -fllvmdc.mak doc
|
||||
make -C $(DIR_RT) -fllvmdc.mak doc
|
||||
make -C $(DIR_GC) -fllvmdc.mak doc
|
||||
|
||||
######################################################
|
||||
|
||||
clean :
|
||||
find . -name "*.di" | xargs $(RM)
|
||||
$(RM) $(ALL_OBJS)
|
||||
$(RM) $(ALL_DOCS)
|
||||
make -C $(DIR_CC) -fllvmdc.mak clean
|
||||
make -C $(DIR_RT) -fllvmdc.mak clean
|
||||
make -C $(DIR_GC) -fllvmdc.mak clean
|
||||
$(RM) $(LIB_MASK)
|
||||
$(RM) $(LIB_MASK_C)
|
||||
$(RM) $(LIB_NAME_NATIVE)*
|
||||
|
||||
install :
|
||||
make -C $(DIR_CC) -fllvmdc.mak install
|
||||
make -C $(DIR_RT) -fllvmdc.mak install
|
||||
make -C $(DIR_GC) -fllvmdc.mak install
|
||||
$(CP) $(LIB_MASK) $(LIB_DEST)/.
|
||||
$(CP) $(LIB_MASK_C) $(LIB_DEST)/.
|
||||
Reference in New Issue
Block a user