]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blame - fx2lib/lib/Makefile
s/make/$(MAKE)/ to fix build on FreeBSD.
[sigrok-firmware-fx2lafw.git] / fx2lib / lib / Makefile
CommitLineData
3608c106
UH
1# Copyright (C) 2009 Ubixum, Inc.
2#
3# This library is free software; you can redistribute it and/or
4# modify it under the terms of the GNU Lesser General Public
5# License as published by the Free Software Foundation; either
6# version 2.1 of the License, or (at your option) any later version.
7#
8# This library is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11# Lesser General Public License for more details.
12#
13# You should have received a copy of the GNU Lesser General Public
14# License along with this library; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
17SOURCES = serial.c i2c.c delay.c setupdat.c gpif.c eputils.c $(wildcard interrupts/*.c)
18FX2_OBJS = $(patsubst %.c,%.rel, $(SOURCES)) usbav.rel int4av.rel
19INCLUDES = -I../include
20SDCC = sdcc -mmcs51 $(SDCCFLAGS)
21LIBS = fx2.lib
22
d1bee53d
UH
23# The sdcc 8051 assembler binary has/had different names.
24ifneq ($(shell which sdas8051),)
25# Newer sdcc, Debian / Ubuntu
26SDAS8051 = sdas8051
27endif
28ifneq ($(shell which sdcc-sdas8051),)
29# Newer sdcc, Fedora
30SDAS8051 = sdcc-sdas8051
31endif
32ifneq ($(shell which asx8051),)
33# Older sdcc
34SDAS8051 = asx8051
35endif
36
3608c106
UH
37all: $(LIBS)
38
39$(LIBS): $(FX2_OBJS)
40 sdcclib fx2.lib $?
41
42usbav.rel: usbav.a51
d1bee53d 43 $(SDAS8051) -logs usbav.a51
3608c106
UH
44
45int4av.rel: int4av.a51
d1bee53d 46 $(SDAS8051) -logs int4av.a51
3608c106
UH
47
48%.rel: %.c
49 $(SDCC) $(INCLUDES) -c $< -o $@
50
51clean:
52 rm -f *.{asm,ihx,lnk,lst,map,mem,rel,rst,sym,adb,cdb,lib}
53 rm -f interrupts/*.{asm,ihx,lnk,lst,map,mem,rel,rst,sym,adb,dcb,lib}
54