1246145Shselasky#
2246145Shselasky# $FreeBSD$
3246145Shselasky#
4246145Shselasky# Copyright (c) 2013 Hans Petter Selasky. All rights reserved.
5246145Shselasky#
6246145Shselasky# Redistribution and use in source and binary forms, with or without
7246145Shselasky# modification, are permitted provided that the following conditions
8246145Shselasky# are met:
9246145Shselasky# 1. Redistributions of source code must retain the above copyright
10246145Shselasky#    notice, this list of conditions and the following disclaimer.
11246145Shselasky# 2. Redistributions in binary form must reproduce the above copyright
12246145Shselasky#    notice, this list of conditions and the following disclaimer in the
13246145Shselasky#    documentation and/or other materials provided with the distribution.
14246145Shselasky#
15246145Shselasky# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16246145Shselasky# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17246145Shselasky# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18246145Shselasky# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19246145Shselasky# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20246145Shselasky# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21246145Shselasky# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22246145Shselasky# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23246145Shselasky# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24246145Shselasky# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25246145Shselasky# SUCH DAMAGE.
26246145Shselasky#
27246145Shselasky
28246145Shselasky#
29246145Shselasky# USB test application
30246145Shselasky#
31246145Shselasky
32246145Shselasky.PATH: ${.CURDIR}
33246145Shselasky
34246145ShselaskyPROG=	usbloader
35246145ShselaskyMAN=
36246145ShselaskySRCS= 
37246145Shselasky
38246145ShselaskyCFLAGS+= -Wall
39246145ShselaskyCFLAGS+= -g
40246145Shselasky
41246145Shselasky.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
42246145ShselaskyCFLAGS+=	-march=i386
43246145ShselaskyCFLAGS+=	-mpreferred-stack-boundary=2
44246145Shselasky.endif
45246145Shselasky.if ${MACHINE_CPUARCH} == "amd64"
46246145ShselaskyCFLAGS+=	-m32
47246145Shselasky.endif
48246145Shselasky
49246145ShselaskyLDFLAGS+= -Wl,--gc-sections
50246145Shselasky
51246145ShselaskySRCS+=	bsd_usbloader_test.c
52246145Shselasky
53246145ShselaskyLDADD+=	libusbboot.a
54246145ShselaskyDPADD+= libusbboot.a
55246145Shselasky
56246145Shselasky.include <bsd.prog.mk>
57246145Shselasky
58246571Shselasky${PROG}: libusbboot.a
59246571Shselasky
60246145Shselaskylibusbboot.a:
61246145Shselasky	make -f Makefile
62