summaryrefslogtreecommitdiffstats
path: root/config.mk
blob: 5d2b2c02888e32a8ab91326e44ccd82b8f98f9b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
CC = ppc64-linux-gcc
CXX = ppc64-linux-g++
LD = ppc64-linux-ld

COMMONFLAGS = -O3 -nostdlib ${EXTRACOMMONFLAGS}
CFLAGS = ${COMMONFLAGS} -mcpu=power7 -nostdinc -g -msoft-float -mno-altivec \
	 -Wall
ASMFLAGS = ${COMMONFLAGS} -mcpu=power7
CXXFLAGS = ${CFLAGS} -nostdinc++ -fno-rtti -fno-exceptions -Wall
LDFLAGS = --nostdlib --sort-common ${COMMONFLAGS}
LDMAPFLAGS = -Map $@.map 

INCDIR = ${ROOTPATH}/src/include/

${OBJDIR}/%.o : %.C
	${CXX} -c ${CXXFLAGS} $< -o $@ -I ${INCDIR}

${OBJDIR}/%.o : %.c
	${CC} -c ${CFLAGS} $< -o $@ -I ${INCDIR}

${OBJDIR}/%.o : %.S
	${CC} -c ${ASMFLAGS} $< -o $@ -Wa,-I${INCDIR}

${OBJDIR}/%.so : ${OBJECTS} ${ROOTPATH}/src/module.ld
	${LD} -shared -z now --gc-sections ${LDFLAGS} $< \
	      -T ${ROOTPATH}/src/module.ld -o $@

${IMGDIR}/%.elf: kernel.ld ${OBJDIR}/*.o ${ROOTPATH}/src/kernel.ld
	${LD} -static ${LDFLAGS} ${LDMAPFLAGS} ${OBJDIR}/*.o \
	      -T ${ROOTPATH}/src/kernel.ld -o $@

${IMGDIR}/%.bin: ${IMGDIR}/%.elf $(wildcard ${IMGDIR}/*.so)
	${ROOTPATH}/src/bld/linker $@ $^

%.d:
	cd ${basename $@} && ${MAKE}

%.clean:
	cd ${basename $@} && ${MAKE} clean
OpenPOWER on IntegriCloud