-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·78 lines (63 loc) · 1.95 KB
/
Makefile
File metadata and controls
executable file
·78 lines (63 loc) · 1.95 KB
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
#
# Makefile
#
# Copyright 2014 Fernando Rodriguez (support@fernansoft.com).
# All rights reserved
#
#
# Note: This makefile has only been tested with
# GNU Make v3.81 on Windows. You may need to modify
# the "toolchain" section bellow (even if you're running
# it on Windows as your tools path may be different)
#
#
# toolchain
#
#CC="C:\Program Files (x86)\Microchip\xc16\v1.21\bin\xc16-gcc.exe"
#AS="C:\Program Files (x86)\Microchip\xc16\v1.21\bin\xc16-gcc.exe"
#AR="C:\Program Files (x86)\Microchip\xc16\v1.21\bin\xc16-ar.exe"
#RM=del /Q
CC=xc16-gcc
AS=xc16-gcc
AR=xc16-ar
RM=rm -f
OPT=-O3
OMF=elf
#
# target libraries
#
LIBRARY_P33E=mp3lib_p33e.a
LIBRARY_P33F=mp3lib_p33f.a
#
# target flags
#
p33f: CFLAGS=-omf=$(OMF) -x c -c -Wall $(OPT) -mlarge-code -mlarge-data -mconst-in-code -funroll-loops -fomit-frame-pointer -fschedule-insns -fschedule-insns2 -mno-eds-warn -mcpu=33FJ256GP710A
p33f: ASFLAGS=-c -mcpu=33FJ256GP710A -omf=$(OMF) -g -Wa
p33e: CFLAGS=-omf=$(OMF) -x c -c -Wall $(OPT) -mlarge-code -mlarge-data -mconst-in-code -funroll-loops -fomit-frame-pointer -fschedule-insns -fschedule-insns2 -mno-eds-warn -mcpu=33EP512GP502
p33e: ASFLAGS=-c -mcpu=33EP512GP502 -omf=$(OMF) -g -Wa
ARFLAGS=-omf=$(OMF) r
#
# sources
#
SOURCES=mp3.c mpeg_2.c mpeg_2__1.c mpeg_2__2.c mpeg_2__3.c mpeg_2__3_huff.c mpeg_2__3_tbl.c mpeg_2_fractional.c mpeg_2_streamreader.c mpeg_2_synth.c
SSOURCES=compiler.s mpeg_2__3_asm.s mpeg_2_bitstream.s mpeg_2_synth_asm.s
OBJECTS=$(SOURCES:.c=.o)
SOBJECTS=$(SSOURCES:.s=.o)
#
# make
#
all: p33f
p33f: clean $(LIBRARY_P33F)
p33e: clean $(LIBRARY_P33E)
$(LIBRARY_P33E): $(OBJECTS) $(SOBJECTS)
$(RM) $(LIBRARY_P33E)
$(AR) $(ARFLAGS) $@ $(OBJECTS) $(SOBJECTS)
$(LIBRARY_P33F): $(OBJECTS) $(SOBJECTS)
$(RM) $(LIBRARY_P33F)
$(AR) $(ARFLAGS) $@ $(OBJECTS) $(SOBJECTS)
.c.o:
$(CC) $(CFLAGS) $< -o $@
.s.o:
$(AS) $(ASFLAGS) $< -o $@
clean:
$(RM) $(OBJECTS) $(SOBJECTS)