From: Royce & S. P. <be...@et...> - 2004-11-15 21:49:57
|
Hi, ----- Original Message ----- > > Alternately(better idea) can SDCC emit a "Done with xx Warnings and xx > > Errors" line just before exiting? > > In case of 0 errors, this will save one from glancing through the > > output to > > check if any error messages exist. > > Oh nono, *please* don't do this. No other compiler does this, ---I am also using AVR-gcc and it emits "Errors:none" at the end. > there are a bunch of situations in which this could be highly > irritating. It is easy enough to accomplish this sort of thing in a makefile. ---I have always used SDCC with all options in the command line. How does one use SDCC with a makefile?Also, what needs to be done in such a makefile to get the message I want emitted? I'm a Windows user. Finally, I dont understand how it can be irritating. SDCC, in any case, emits errors & warnings if present, so how can it hurt if it merely summarises the number of errors /warnings at the end? Anyways, this is a very minor issue-I really don't mean to make a big deal of it. Thanks & regards, --Royce. |
From: Dave M. <mc...@ne...> - 2004-11-16 17:38:37
|
On Nov 15, 2004, at 4:49 PM, Royce & Sharal Pereira wrote: >>> Alternately(better idea) can SDCC emit a "Done with xx Warnings and >>> xx >>> Errors" line just before exiting? >>> In case of 0 errors, this will save one from glancing through the >>> output to >>> check if any error messages exist. >> >> Oh nono, *please* don't do this. No other compiler does this, > > ---I am also using AVR-gcc and it emits "Errors:none" at the end. But does it beep? ;) > ---I have always used SDCC with all options in the command line. How > does > one use SDCC with a makefile?Also, what needs to be done in such a > makefile > to get the message I want emitted? I'm a Windows user. I have no idea how one would use make (which is what uses makefiles) under Windows. If someone else here can address that question, I would be happy to send you several of my makefiles as examples. > Finally, I dont understand how it can be irritating. When my girlfriend is asleep in the next room and I'm working late on a project is one example. > SDCC, in any case, emits errors & warnings if present, so how can it > hurt if > it merely summarises the number of errors /warnings at the end? I don't have a problem with that, perhaps enabled (or disabled) by a command-line switch. > Anyways, this is a very minor issue-I really don't mean to make a big > deal > of it. Me neither, just voicing my opinion, and I respect yours. -Dave -- Dave McGuire "I wonder what 'Error Code 1' means. That's Cape Coral, FL what it said when it started smoking." -Jonathan Patschke |
From: Rod B. <ro...@bo...> - 2004-11-16 20:02:40
|
All, make file programming is a lost art I. Most developers I have seen are quite lazy and would prefer to use a GUI. When if you want to know about make files this is the GNU manual http://www.gnu.org/software/make/manual/html_mono/make.html you cannot get a better reference. GNU make is the best to use there is a port for windows, DOS and of source Linux. There are plenty of makefiles being used by SDCC I will include a makefile here from an SDCC project I have been playing around with: >>> Cut after here >>> VPATH = ./:../uip/:../apps/httpd/ CC = sdcc #VERBOSE = -V CPPFLAGS = -I./ -I ../uip -I ../apps/httpd -DFS_STATISTICS=1 #-DUIP_LOGGING=1 #CFLAGS = $(VERBOSE) $(CPPFLAGS) -mmcs51 --debug --stack-after-data --model-large #LFLAGS = $(VERBOSE) -mmcs51 --debug --stack-after-data --model-large -L../uip -L../apps/httpd #LFLAGS = $(VERBOSE) -mmcs51 --debug --model-large -L../uip -L../apps/httpd CFLAGS = $(VERBOSE) $(CPPFLAGS) -mmcs51 --debug --model-large LFLAGS = $(VERBOSE) -mmcs51 --debug --model-large -L./ TST_SRC = sdcc_test.c sys_tic.c serial.c rs232dev.c APP_SRC = $(TST_SRC) uip_arch.c SOURCES = $(APP_SRC) uip.c httpd.c fs.c cgi.c #SOURCES = $(APP_SRC) ../uip/uip.c APP_OBJ = $(patsubst %.c,%.rel,$(APP_SRC)) TST_OBJ = $(patsubst %.c,%.rel,$(TST_SRC)) OBJECTS = $(APP_OBJ) uip.rel httpd.rel fs.rel cgi.rel #OBJECTS = $(APP_OBJ) uip.rel all: depend libs uip uip: $(OBJECTS) depend $(CC) --verbose $(LFLAGS) -l libuip.lib -l libhttpd.lib $(APP_OBJ) # $(CC) $(LFLAGS) -l libuip.lib $(APP_OBJ) packihx sdcc_test.ihx > sdcc_test.txt unix2dos -n -q sdcc_test.txt sdcc_test.hex test: $(TST_OBJ) depend $(CC) $(LFLAGS) $(TST_OBJ) cp sdcc_test.ihx test.ihx packihx test.ihx > test.txt unix2dos -n -q test.txt test.hex VPATH=../uip:../apps/httpd tunslip: tunslip.c gcc -o tunslip tunslip.c clean: rm -f *.rel *~ *core *.s *.asm *.cdb *.lst *.sym *.rst *.asm *.cdb *.rel \ *.lst *.sym *.rst *.lib *~ *.asm *.adb *.rel *.lst *.sym *.rst *.lib *~ distclean: clean rm -f *.ihx *.hex *.map *.txt *.lnk *.dep %.rel: %.c # @echo $(CC) -c $(CFLAGS) $< $(CC) -c $(CFLAGS) $< libs: echo uip > libuip.lib echo httpd > libhttpd.lib echo fs >> libhttpd.lib echo cgi >> libhttpd.lib # echo uip > ../uip/libuip.lib # echo httpd > ../apps/httpd/libhttpd.lib # echo fs >> ../apps/httpd/libhttpd.lib # echo cgi >> ../apps/httpd/libhttpd.lib # Creating dependencies # --------------------- depend: Makefile.dep Makefile.dep: $(SOURCES) rm -f Makefile.dep for i in $(SOURCES); do \ $(CC) -M $(CPPFLAGS) $$i >$${i}.dep; \ cat $${i}.dep >>Makefile.dep; \ rm $${i}.dep; \ done include Makefile.dep <<< Cut before here <<< Hope this helps there are lots of interesting things in this make I hope somebody can make use of it. The dependency part may not work under windows but the rest should. Regards, Rod Boyce. Royce & Sharal Pereira wrote: >---I have always used SDCC with all options in the command line. How does >one use SDCC with a makefile?Also, what needs to be done in such a makefile >to get the message I want emitted? I'm a Windows user. >Finally, I dont understand how it can be irritating. >SDCC, in any case, emits errors & warnings if present, so how can it hurt if >it merely summarises the number of errors /warnings at the end? > >Anyways, this is a very minor issue-I really don't mean to make a big deal >of it. > >Thanks & regards, >--Royce. > > > >------------------------------------------------------- >This SF.Net email is sponsored by: InterSystems CACHE >FREE OODBMS DOWNLOAD - A multidimensional database that combines >robust object and relational technologies, making it a perfect match >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 >_______________________________________________ >Sdcc-user mailing list >Sdc...@li... >https://lists.sourceforge.net/lists/listinfo/sdcc-user > > |
From: Dave M. <mc...@ne...> - 2004-11-16 20:45:23
|
On Nov 16, 2004, at 3:02 PM, Rod Boyce wrote: > make file programming is a lost art I. Most developers I have seen > are quite lazy and would prefer to use a GUI. In the PC world, perhaps. However, in the world of large software development projects (non-embedded operating systems for example), GUIs are most definitely not the mainstay of development. Personally, however, I use makefiles because I am lazy. :) I just don't have the patience to deal with the maze of inconsistent, often-unstable GUIfied "programming" tools. Now, that said, I like GUIs as much as the next guy...but programming is a textual task, and probably always will be. Just because one can GUIfy a task doesn't necessarily mean one should. Just my opinion. -Dave -- Dave McGuire "I wonder what 'Error Code 1' means. That's Cape Coral, FL what it said when it started smoking." -Jonathan Patschke |
From: Rod B. <ro...@bo...> - 2004-11-17 07:20:55
|
All, < / rant on > I have one other thing to say about makefiles and that is that a lot of the big makefile systems I have seen are wrong and use recursion to solve problems that only cause more problems than they solve. Have a look at this paper http://aegis.sourceforge.net/auug97.pdf I found it after I wrote the makefile I posted to this list but this has changed the way I write big makefiles and I would say speed up compile times in some cases by as much as 100-times. Makefile programming is becoming a lost art at least in the circles I have travelled in I have yet to meet anybody who knows more about makefile than myself and I still look up the manual when I want to do some things. < / rant off > Dave I could not agree with you more if any one is interested I could port the makefile I posted here so that it will work on windows. Regards, Rod Boyce Dave McGuire wrote: > On Nov 16, 2004, at 3:02 PM, Rod Boyce wrote: > >> make file programming is a lost art I. Most developers I have seen >> are quite lazy and would prefer to use a GUI. > > > In the PC world, perhaps. However, in the world of large software > development projects (non-embedded operating systems for example), > GUIs are most definitely not the mainstay of development. > > Personally, however, I use makefiles because I am lazy. :) I just > don't have the patience to deal with the maze of inconsistent, > often-unstable GUIfied "programming" tools. > > Now, that said, I like GUIs as much as the next guy...but > programming is a textual task, and probably always will be. Just > because one can GUIfy a task doesn't necessarily mean one should. > > Just my opinion. > > -Dave > > -- > Dave McGuire "I wonder what 'Error Code 1' means. That's > Cape Coral, FL what it said when it started smoking." > -Jonathan Patschke > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: InterSystems CACHE > FREE OODBMS DOWNLOAD - A multidimensional database that combines > robust object and relational technologies, making it a perfect match > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > _______________________________________________ > Sdcc-user mailing list > Sdc...@li... > https://lists.sourceforge.net/lists/listinfo/sdcc-user |
From: Rod B. <ro...@bo...> - 2004-12-03 07:22:38
|
Pedro and All, As requested here is a copy of the makefile I posted earlier but this time ported to windows. I have just made it work under windows and made the dependency checking work under windows or Linux it means that the dependencies are also made for make distclean as well if make distclean is performed twice. I can live with this but if somebody wants to improve it help yourself. # This makefile has been tested with a very old version of make # The output from 'make --version' is detailed below # GNU Make version 3.78.1, by Richard Stallman and Roland McGrath. # Built for Windows32 # Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 # Free Software Foundation, Inc. # This is free software; see the source for copying conditions. # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # # Report bugs to <bug...@gn...>. # # It would appear that the latest version of make has a problem with the backslash # These might have to be changed to work with a later version. VPATH=../uip:../apps/httpd # Path to the sdcc execautable SDCC_BIN := ..\..\..\bin # use this compiler CC := $(SDCC_BIN)\sdcc # Uncommet this to have the compiler make heaps of noise #VERBOSE := -V # Here are the command line arguments for the compiler to compile a .c file CFLAGS := # Add include paths here CFLAGS += -I./ CFLAGS += -I ../uip CFLAGS += -I ../apps/httpd # Add extra defines here CFLAGS += -DFS_STATISTICS=1 CFLAGS += -DUIP_LOGGING=1 # Add process specific arguments here CFLAGS += $(VERBOSE) CFLAGS += -mmcs51 CFLAGS += --debug CFLAGS += --model-large # Here are the linker command line arguments LFLAGS := LFLAGS += $(VERBOSE) # Add processor specific arguments here for the linker LFLAGS += -mmcs51 LFLAGS += --debug LFLAGS += --model-large LFLAGS += -L. #LFLAGS += --verbose #LFLAGS += --stack-after-data #LFLAGS += --model-large # source files for one of the targets TST_SRC := sdcc_test.c TST_SRC += sys_tic.c TST_SRC += serial.c TST_SRC += rs232dev.c # Source files for another target APP_SRC := $(TST_SRC) APP_SRC += uip_arch.c # All the source files in one variable SOURCES := SOURCES += $(APP_SRC) SOURCES += uip.c SOURCES += httpd.c SOURCES += fs.c SOURCES += cgi.c # Convert source files to object files for targets APP_OBJ := $(patsubst %.c,%.rel,$(APP_SRC)) TST_OBJ := $(patsubst %.c,%.rel,$(TST_SRC)) # Object files for a target OBJECTS := $(APP_OBJ) OBJECTS += uip.rel OBJECTS += httpd.rel OBJECTS += fs.rel OBJECTS += cgi.rel # Rule to make depend files from source files %.d : %.c $(CC) -M $(CFLAGS) $< > $@ # Rule to make object feils form soure files %.rel: %.c $(CC) -c $(CFLAGS) $< # first and default target all: libs uip # main target uip: $(OBJECTS) $(CC) $(LFLAGS) -l libuip.lib -l libhttpd.lib $(APP_OBJ) $(SDCC_BIN)\packihx sdcc_test.ihx > sdcc_test.txt # delete all compiler generated files for all directories clean: @if exist *.adb del *.adb @if exist *.asm del *.asm @if exist *.lst del *.lst @if exist *.rel del *.rel @if exist *.sym del *.sym @if exist ..\uip\*.adb del ..\uip\*.adb @if exist ..\uip\*.asm del ..\uip\*.asm @if exist ..\uip\*.lst del ..\uip\*.lst @if exist ..\uip\*.rel del ..\uip\*.rel @if exist ..\uip\*.sym del ..\uip\*.sym @if exist ..\apps\httpd\*.adb del ..\apps\httpd\*.adb @if exist ..\apps\httpd\*.asm del ..\apps\httpd\*.asm @if exist ..\apps\httpd\*.lst del ..\apps\httpd\*.lst @if exist ..\apps\httpd\*.rel del ..\apps\httpd\*.rel @if exist ..\apps\httpd\*.sym del ..\apps\httpd\*.sym @if exist *.s del *.s @if exist *.cdb del *.cdb @if exist *.lib del *.lib @if exist *.c~ del *.c~ @if exist *~ del *~ @if exist *.h~ del *.h~ @if exist *.rel del *.rel @if exist *.rst del *.rst # Delete output files as well. distclean: clean @if exist *.ihx del *.ihx @if exist *.hex del *.hex @if exist *.map del *.map @if exist *.mem del *.mem @if exist *.lnk del *.lnk @if exist *.d del *.d # Create libraries files libs: echo ../uip/uip.rel > libuip.lib echo ../apps/httpd/httpd.rel > libhttpd.lib echo ../apps/httpd/fs.rel >> libhttpd.lib echo ../apps/httpd/cgi.rel >> libhttpd.lib # Creating dependencies # --------------------- depend: $(patsubst %.c,%.d,$(SOURCES)) # include dependency files in makefile include $(patsubst %.c,%.d,$(SOURCES)) It would also appear that there are some differences between what my old version of SDCC does and with this new version does so I have also compensated for that as well. Anyway I hope this helps somebody out. If this is too far off topic please accept my aploigies. Regards, Rod Boyce Pedro Ignacio Martos wrote: >>>Hi Rod, >>> >>>I would like to work with a makefile in windows, so could you please send >>>it? Thanks in advance >>> >>>best regards, >>>Pedro Martos >>> >>> >>> >>> -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning. |
From: Tommaso M. <tma...@ho...> - 2004-12-03 13:28:53
|
Hi all, I'm starting to use your great compiler for a my project, where PIC14 are involved. I well know the compiler is still in alfa stage, but I'm also sure you are interested in be advised about all troubles I can meet on my way! Here the first problem: this is the source file - - - - - - - - - - - - - - - - - - - - - - - - - - #include "pic16F627.h" void sample(unsigned char nPin) { unsigned char mask = 0x01 << nPin; PORTA = mask; } - - - - - - - - - - - - - - - - - - - - - - - - - - this is (part of) the compiler output: - - - - - - - - - - - - - - - - - - - - - - - - - - ;-------------------------------------------------------- ; File Created by SDCC : FreeWare ANSI-C Compiler ; Version 2.4.7 #896 (Dec 2 2004) ; This file generated Fri Dec 03 14:10:16 2004 ;-------------------------------------------------------- ; PIC port for the 14-bit core ;-------------------------------------------------------- ; void sample(unsigned char nPin) BANKSEL r0x20 MOVWF r0x20 ;#CSRC C:/tom/pic/sdcc/test/pippo.c 5 ; unsigned char mask = 0x01 << nPin; MOVF 0x01,W BCF STATUS,5 BCF STATUS,6 MOVWF _PORTA BANKSEL r0x20 COMF r0x20,W BCF STATUS,5 BCF STATUS,6 RRF _PORTA,F _00107_DS_ RLF _PORTA,F ADDLW 0x01 BTFSS STATUS,0 GOTO _00107_DS_ ;#CSRC C:/tom/pic/sdcc/test/pippo.c 7 ; PORTA = mask; RETURN - - - - - - - - - - - - - - - - - - - - - - - - - - in my opinion the line ; unsigned char mask = 0x01 << nPin; MOVF 0x01,W should be like ; unsigned char mask = 0x01 << nPin; MOVLW 0x01 This fix to the PIC source code made the PIC happy, so I think it's better to have your opinion (would be nice also to have the compiler fixed!) :) I used sdcc.exe built on december, 2 (yesterday) Please let me know If you like this kind of mail, I could report some other problem I could find in the following weeks. Best regards Tommaso Massimi to...@us... |