How can I use make file for D?

In the past, I wrote complex C and C ++ make files. However, I cannot get my make make file to work. It produces more than a thousand lines of undefined reference errors that look as if Phobos was not connected. How can i fix this?

I am using GNU make and LDC2 for Linux Fedora 19.

Edit: Compiling and binding directly using LDC2 works correctly. Only when called with "make" is there an error. It seems that make is trying to invoke a separate linker.

Edit 2: Here is my make file:

# This macro contains the source files
sources := $(wildcard *.d)

binaries := $(sources:%.d=%)

all: $(binaries)

%.o:%.d
        ldc2 $< -O5 -check-printf-calls

.O removal fixed.

+4
source share
1 answer

, , .

%.o:%.d
    ldc2 $< -O5 -check-printf-calls

make .d .o, ldc2. ldc2 , ( , dmd/gdc: -c). .

.o, , Make .d , .

+6

All Articles