##// END OF EJS Templates
added rules.mk for generic Makefile and makefile example for LCD demo files
Alexis -
r23:d0444fda4b79 default
parent child
Show More
@@ -0,0 +1,42
1 #------------------------------------------------------------------------------
2 #-- This file is a part of the LPP VHDL IP LIBRARY
3 #-- Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS
4 #--
5 #-- This program is free software; you can redistribute it and/or modify
6 #-- it under the terms of the GNU General Public License as published by
7 #-- the Free Software Foundation; either version 3 of the License, or
8 #-- (at your option) any later version.
9 #--
10 #-- This program is distributed in the hope that it will be useful,
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #-- GNU General Public License for more details.
14 #--
15 #-- You should have received a copy of the GNU General Public License
16 #-- along with this program; if not, write to the Free Software
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #------------------------------------------------------------------------------
19
20 include ../../../rules.mk
21 LIBDIR = ../../../lib/
22 INCPATH = ../../../includes/
23 SCRIPTDIR=../../../scripts/
24 LIBS=-lapb_lcd_driver -llpp_apb_functions
25 INPUTFILE=main.c
26 EXEC=main.bin
27 OUTBINDIR=bin/
28
29
30 all:bin
31 @echo $(EXEC)" file created"
32
33 clean:
34 rm -f *.{o,a}
35
36
37
38 help:ruleshelp
39 @echo " all : makes an executable file called "$(EXEC)
40 @echo " in "$(OUTBINDIR)
41 @echo " clean : removes temporary files"
42
1 NO CONTENT: new file 100755, binary diff hidden
NO CONTENT: new file 100755, binary diff hidden
@@ -0,0 +1,1
1 load bin/main.bin
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -1,44 +1,63
1 #------------------------------------------------------------------------------
1 #------------------------------------------------------------------------------
2 #-- This file is a part of the LPP VHDL IP LIBRARY
2 #-- This file is a part of the LPP VHDL IP LIBRARY
3 #-- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
3 #-- Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS
4 #--
4 #--
5 #-- This program is free software; you can redistribute it and/or modify
5 #-- This program is free software; you can redistribute it and/or modify
6 #-- it under the terms of the GNU General Public License as published by
6 #-- it under the terms of the GNU General Public License as published by
7 #-- the Free Software Foundation; either version 3 of the License, or
7 #-- the Free Software Foundation; either version 3 of the License, or
8 #-- (at your option) any later version.
8 #-- (at your option) any later version.
9 #--
9 #--
10 #-- This program is distributed in the hope that it will be useful,
10 #-- This program is distributed in the hope that it will be useful,
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #-- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #-- GNU General Public License for more details.
13 #-- GNU General Public License for more details.
14 #--
14 #--
15 #-- You should have received a copy of the GNU General Public License
15 #-- You should have received a copy of the GNU General Public License
16 #-- along with this program; if not, write to the Free Software
16 #-- along with this program; if not, write to the Free Software
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #------------------------------------------------------------------------------
18 #------------------------------------------------------------------------------
19
19
20 CC = sparc-elf-gcc
20 CC = sparc-elf-gcc
21 AR = sparc-elf-ar
21 AR = sparc-elf-ar
22 LIBDIR = ../../lib/
22 LIBDIR = ../../lib/
23 INCPATH = ../../includes/
23 INCPATH = ../../includes/
24
24 SCRIPTDIR=../../scripts/
25 OUTBINDIR=bin/
26 EXEC=exec.bin
27 INPUTFILE=main.c
25
28
26 $(FILE): $(FILE).a
29 $(FILE): $(FILE).a
27 @echo "library ""lib"$(FILE)" created"
30 @echo "library ""lib"$(FILE)" created"
28
31
29
32
30 $(FILE).o:
33 $(FILE).o:
31 mkdir tmp
34 mkdir tmp
32 $(CC) -c $(FILE).c -I $(INCPATH) -o tmp/$(FILE).o
35 $(CC) -c $(FILE).c -I $(INCPATH) -o tmp/$(FILE).o
33
36
34 $(FILE).a: $(FILE).o
37 $(FILE).a: $(FILE).o
35 $(AR) rs $(LIBDIR)"lib"$(FILE).a tmp/$(FILE).o
38 $(AR) rs $(LIBDIR)"lib"$(FILE).a tmp/$(FILE).o
36 cp *.h $(INCPATH)
39 cp *.h $(INCPATH)
37 rm -R tmp
40 rm -R tmp
38
41
42 load: all
43 @echo "load "$(OUTBINDIR)$(EXEC)>$(SCRIPTDIR)load.txt
44 grmon-eval -uart $(PORT) -u -c $(SCRIPTDIR)load.txt
45
46 bin:
47 mkdir -p $(OUTBINDIR)
48 $(CC) $(INPUTFILE) -o $(OUTBINDIR)/$(EXEC) -I $(INCPATH) -L $(LIBDIR) -static $(LIBS)
49
39 clean:
50 clean:
40 rm -f -R tmp
51 rm -f -R tmp
41 rm -f *.{o,a}
52 rm -f *.{o,a}
42 rm -f $(INCPATH)*.h
53 rm -f $(INCPATH)*.h
43 rm -f $(LIBDIR)*.{o,a}
54 rm -f $(LIBDIR)*.{o,a}
44
55
56 ruleshelp:
57 @echo ""
58 @echo ""
59 @echo ""
60 @echo " load : call grmon-eval and loads "$(EXEC)" in the leon"
61 @echo " usage: make PORT=/dev/ttyUSBx load"
62
63
General Comments 0
You need to be logged in to leave comments. Login now