Makefile 2.53 KB
Newer Older
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
# Makefile for GNU defmod
#
# ***********************************
# ***    C h a n g e   L i s t    ***
# ***********************************
# Date       Name         Description
# ----       ----         -----------
# 16-Nov-99  SNB          Created.
#

#
# Paths
#
LIBDIR  = ${INSTDIR}.Library.Build
INSTAPP = ${INSTDIR}.Apps.!DefMod

VPATH = @ sources bs support

#
# Generic options:
#
MKDIR   = do mkdir -p
AS      = objasm
CP      = copy
CC      = cc
CM      = cmhg
RM      = remove
LD      = link
LB      = libfile
TOUCH   = create
SQZ	= squeeze
WIPE    = -wipe
YACC    = GNU.bison

CCFLAGS = -c -depend !Depend -ffa ${INCLUDES} ${THROWBACK} -DTRACE=0 -Wp
YACCDEFS= -DYYDEBUG=0 -DYYMAXDEPTH=0
ASFLAGS = -depend !Depend -Stamp -quit ${THROWBACK} ${ASMINC}
CPFLAGS = ~cfr~v
LBFLAGS = -c
WFLAGS  = ~CFR~V
SQZFLAGS = -f
YACCFLAGS = -y


#
# Libraries
#
CLIB      = CLIB:o.stubs
RLIB      = RISCOSLIB:o.risc_oslib
RSTUBS    = RISCOSLIB:o.rstubs
ROMSTUBS  = RISCOSLIB:o.romstubs
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM    = RISC_OSLib:o.AbsSym
UNIXLIB	  = TCPIPLibs:o.unixlib

DIRS=o._dirs

#
# Include files
#
INCLUDES  = -Jbs.,support.,C: -Ibs -Isources -Isupport -IC:
ASMINC    = -Ibs -Isources -Isupport

#
# Program specific options:
#
COMPONENT  = defmod
ICOMPONENT = !Run
TARGET     = ${COMPONENT}
SOURCE     = 
EXPORTS    = 


OBJS=o.asmhelp o.callback o.chelp o.def o.defmod o.cheader o.hdr \
      o.lookup o.objasm o.realloc o.resource o.riscos o.riscosa o.cstrong

LIBS=${CLIB}

#
# Rule patterns
#
.SUFFIXES: .o .c .y .s
.c.o:;     ${CC} ${CCFLAGS} -o $@ $<
.s.o:;     ${AS} ${ASFLAGS} -o $@ $<
85 86 87 88


c.defmod: sources.y.defmod
        ${YACC} ${YACCFLAGS} -o $@ sources.y.defmod
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141

o.defmod: c.defmod
	${CC} ${CCFLAGS} ${YACCDEFS} -o $@ c.defmod

#
# build defmod
#
all:	${TARGET}
	@|

install: all
	${MKDIR} ${LIBDIR}.DefMod
	${CP} ${TARGET} ${LIBDIR}.DefMod.!Run ${CPFLAGS}
	@echo Installation of tool ${COMPONENT} complete

#
# RISC OS ROM build rules:
#
rom: ${TARGET}
        @echo ${COMPONENT}: rom module built

export: export_${PHASE}

install_rom: ${TARGET}
        @echo ${COMPONENT}: rom module installed

clean:
        ${WIPE} c ${WFLAGS}
        ${WIPE} o ${WFLAGS}
        ${RM} ${COMPONENT}
        @echo ${COMPONENT}: cleaned

export_hdrs: 
	@echo ${COMPONENT}: export complete (hdrs)

export_libs: 
        @echo ${COMPONENT}: export complete (libs)

${DIRS}:
	${MKDIR} c
	${MKDIR} o
	create $@


#
# Final link
#
${TARGET}: ${OBJS} ${LIBS} ${DIRS}
        ${LD} ${LDFLAGS} -o ${COMPONENT} ${OBJS} ${LIBS}
        ${SQZ} ${SQZFLAGS} $@


# Dynamic dependencies: