Makefile 3.71 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# Copyright 2003 Tematic Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Make file for RISC OS port of NetBSD USB code
# 
# This makefile generates the main USBDriver and the controller drivers
# by including the relevant object file.

TARGET          = ${COMPONENT}
21
DIRS            = o._dirs
22
MESSAGELOCATION = Resources.${COMPONENT}.Messages
23 24
LIBS            = ${DEBUGLIB} ${NET5LIBS} ${CALLXLIB} ${ASMUTILS} ${TBOXLIBS}
RDIR            = ${RESDIR}.${COMPONENT}
25

26 27 28
CINCLUDES       = -Itbox:,TCPIPLibs:,^.,OS:
CDEFINES        += ${CDEBUG} -DKERNEL -Dpaddr_t=int -D__P(A)=A -DKLD_MODULE
CMHGINCLUDES    = ${CINCLUDES}
29
CMHGDEFINES     = -DMESSAGELOCATION=${MESSAGELOCATION} ${CDEBUG}
30 31
CFLAGS          += -ff -wp -wc -zm -zps1
LDFLAGS         = -LIST maps.${TARGET} -MAP -Xref
32 33 34 35 36 37 38 39 40 41 42 43 44

VPATH = ^.build ^.dev.usb

include OBJ${COMPONENT}

include StdTools
include ModStdRule
#MODSQZ = echo not squeezing... 
include ModuleLibs
include RAMCModule
include ROMCModule

clean:
45 46 47 48 49 50 51 52 53
        ${WIPE} o      ${WFLAGS}
        ${WIPE} aif    ${WFLAGS}
        ${WIPE} aof    ${WFLAGS}
        ${WIPE} rm     ${WFLAGS}
        ${WIPE} i      ${WFLAGS}
        ${WIPE} maps   ${WFLAGS}
        ${WIPE} gpa    ${WFLAGS}
        ${WIPE} bin    ${WFLAGS}
        ${WIPE} linked ${WFLAGS}
54 55 56
        ${RM}   h.ohcimodhead
        ${RM}   h.usbmodhead
        ${RM}   Resources.UK.USBDevs
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73

all: o._dirs

resources: resources_${COMPONENT}

resources_OHCIDriver: LocalRes:OHCIMessages
        ${MKDIR} ${RDIR}
        ${CP} LocalRes:OHCIMessages ${RDIR}.Messages ${CPFLAGS}
        @echo ${COMPONENT}: resource files copied

resources_USBDriver: LocalRes:USBDriver LocalRes:USBDevs
        ${MKDIR} ${RDIR}
        ${CP} LocalRes:USBMessages ${RDIR}.Messages ${CPFLAGS}
        ${CP} LocalRes:USBDevs ${RDIR}.USBDevs ${CPFLAGS}
        @echo ${COMPONENT}: resource files copied

o._dirs:
74 75 76 77 78 79 80 81 82 83 84 85
        ${MKDIR} o
        ${MKDIR} aif
        ${MKDIR} aof
        ${MKDIR} rm
        ${MKDIR} i
        ${MKDIR} maps
        ${MKDIR} gpa
        ${MKDIR} bin
        ${TOUCH} o._dirs

ohcimodule.o:   ohcimodhead.h USBDriver.h
usbmodule.o usbkboard.o:        usbmodhead.h
86 87

Resources.UK.USBDevs: bin.makedevs
88
        bin.makedevs > Resources.UK.USBDevs
89 90 91 92

# Remove the usbmodhead after creating the SWI table because if OHCIDriver
# makes it then it has the wrong messages file in it
USBDriver.h: usbmodhead.h
93 94 95
        ${SED} -n "/define USBDriver_/p" h.usbmodhead > h.USBDriver
        ${RM}   h.usbmodhead
        ${RM}   o.usbmodhead
96 97

bin.makedevs: o.makedevs ${CLIB}
98
        ${LD} -o $@ o.makedevs ${CLIB}
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116

usbmsgs.o: Resources.UK.USBMessages Resources.UK.USBDevs
        resgen resource_files o.usbmsgs Resources.UK.USBMessages ${MESSAGELOCATION} Resources.UK.USBDevs Resources.USBDriver.USBDevs

ohcimsgs.o: Resources.UK.OHCIMessages
        resgen resource_files o.ohcimsgs Resources.UK.OHCIMessages ${MESSAGELOCATION}

# RISC OS debug:
aif.${COMPONENT}: ${RAM_OBJS} ${RAM_LIBS} ${CLIB} ${DIRS}
        link -base 0 -aif -bin -d -o $@ ${RAM_OBJS} ${RAM_LIBS} ${CLIB}

gpa.${COMPONENT}: aif.${COMPONENT}
        togpa -s aif.${COMPONENT} $@

debug: gpa.${COMPONENT} ${DIRS}

.SUFFIXES: .i

117
.c.i:;  ${CC} -E ${CFLAGS} $< > $@
118 119 120 121 122

listing: i.ohci i.ohcimodule i.usb i.usbdi i.usbdi_util i.usb_subr i.ugen i.usbmodule


# Dynamic dependencies: