Ticket #4028: Makefile

File Makefile, 547 bytes (added by meianoite, 14 years ago)

Makefile

Line 
1VALIDATE_DRV ?= 0
2
3LD ?= ld
4AS ?= as
5
6PROG= new_haiku_gpt_mbr
7SRCS= ${PROG}.S
8
9ORG= 0x600
10
11LDFLAGS=-N -e start -Ttext ${ORG} -S --oformat binary
12
13SUFFIX=
14AS_SYM_VLD=
15AS_SFX_VLD = _validate
16
17
18ifeq (1,${VALIDATE_DRV})
19AS_SYM_VLD = --defsym VALIDATE_DRV=${VALIDATE_DRV}
20SUFFIX=${strip $(AS_SFX_VLD)}
21endif
22
23
24all: ${PROG}
25
26${PROG}.o: ${PROG}.S
27 ${AS} ${AS_SYM_VLD} -o ${PROG}.o ${SRCS}
28
29
30${PROG}: ${PROG}.o
31 ${LD} ${LDFLAGS} -o ${PROG}${SUFFIX} ${PROG}.o
32
33
34clean:
35 rm ${PROG} ${PROG}${strip $(AS_SFX_VLD)} ${PROG}.o