ccomx-develop Mailing List for CCOM - a lib for serial port interface
Brought to you by:
chrisan,
rasmusmyklebust
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(7) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
|
Feb
(62) |
Mar
|
Apr
|
May
(4) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(4) |
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
|
2
|
3
|
4
|
5
|
6
|
|
7
|
8
(3) |
9
|
10
|
11
|
12
|
13
|
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
|
28
|
29
|
30
|
|
|
|
|
|
From: Rasmus M. <ras...@us...> - 2004-11-08 21:17:59
|
Update of /cvsroot/ccomx/ccom/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1726 Modified Files: ccom.h Log Message: Line endings Index: ccom.h =================================================================== RCS file: /cvsroot/ccomx/ccom/include/ccom.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ccom.h 21 Jun 2004 19:17:54 -0000 1.7 --- ccom.h 8 Nov 2004 21:17:48 -0000 1.8 *************** *** 1,37 **** ! #ifndef CCOM_H ! #define CCOM_H ! ! #define CCOM_VERSION_MAJOR 0 ! #define CCOM_VERSION_MINOR 9 ! #define CCOM_VERSION_PATCH 2 ! #define CCOM_VERSION_STRING "0.9.2" ! #define CCOM_DATE 20040611 /* yyyymmdd */ ! #define CCOM_DATE_STRING "Jun 11, 2004" ! ! #include "ccom/ccomcfg.h" ! ! #define CCOM_COM1 0 ! #define CCOM_COM2 1 ! #define CCOM_COM3 2 ! #define CCOM_COM4 3 ! ! #define CCOM_ERR_ORUN (1 << 0) ! #define CCOM_ERR_PAR (1 << 1) ! #define CCOM_ERR_FRAME (1 << 2) ! ! CCOM_FUNC(int, CcomSettingsDialogue, (int portno)); ! CCOM_FUNC(int, CcomSendBuffer, (int portnr, const char *buffer, int n, CCOM_METHOD(void, Notify, (int portnr, void *data)), void *data)); ! CCOM_FUNC(int, CcomStartScanning, (int portnr, int options, CCOM_METHOD(void, CallBack, (int portnr, int readdata, int error, void *data)), void *data)); ! CCOM_FUNC(void, CcomSetPath, (const char *path)); ! ! CCOM_FUNC(int, CcomStopSending, (int portno)); ! CCOM_FUNC(int, CcomStopScanning, (int portno)); ! ! CCOM_FUNC(int, CcomSetBaud, (int portno, long baud_rate)); ! CCOM_FUNC(int, CcomSetBits, (int portno, int nobits)); ! CCOM_FUNC(int, CcomSetStopBits, (int portno, int stopbits)); ! CCOM_FUNC(int, CcomSetParity, (int portno, int parity)); ! CCOM_FUNC(int, CcomSetParityEnable, (int portno, int parityenable)); ! CCOM_FUNC(void, CcomLoopBackMode, (int portno, int mode)); ! ! #endif --- 1,37 ---- ! #ifndef CCOM_H ! #define CCOM_H ! ! #define CCOM_VERSION_MAJOR 0 ! #define CCOM_VERSION_MINOR 9 ! #define CCOM_VERSION_PATCH 2 ! #define CCOM_VERSION_STRING "0.9.2" ! #define CCOM_DATE 20040611 /* yyyymmdd */ ! #define CCOM_DATE_STRING "Jun 11, 2004" ! ! #include "ccom/ccomcfg.h" ! ! #define CCOM_COM1 0 ! #define CCOM_COM2 1 ! #define CCOM_COM3 2 ! #define CCOM_COM4 3 ! ! #define CCOM_ERR_ORUN (1 << 0) ! #define CCOM_ERR_PAR (1 << 1) ! #define CCOM_ERR_FRAME (1 << 2) ! ! CCOM_FUNC(int, CcomSettingsDialogue, (int portno)); ! CCOM_FUNC(int, CcomSendBuffer, (int portnr, const char *buffer, int n, CCOM_METHOD(void, Notify, (int portnr, void *data)), void *data)); ! CCOM_FUNC(int, CcomStartScanning, (int portnr, int options, CCOM_METHOD(void, CallBack, (int portnr, int readdata, int error, void *data)), void *data)); ! CCOM_FUNC(void, CcomSetPath, (const char *path)); ! ! CCOM_FUNC(int, CcomStopSending, (int portno)); ! CCOM_FUNC(int, CcomStopScanning, (int portno)); ! ! CCOM_FUNC(int, CcomSetBaud, (int portno, long baud_rate)); ! CCOM_FUNC(int, CcomSetBits, (int portno, int nobits)); ! CCOM_FUNC(int, CcomSetStopBits, (int portno, int stopbits)); ! CCOM_FUNC(int, CcomSetParity, (int portno, int parity)); ! CCOM_FUNC(int, CcomSetParityEnable, (int portno, int parityenable)); ! CCOM_FUNC(void, CcomLoopBackMode, (int portno, int mode)); ! ! #endif |
|
From: Rasmus M. <ras...@us...> - 2004-11-08 21:16:47
|
Update of /cvsroot/ccomx/ccom/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1343 Modified Files: ccom._tx readme._tx Log Message: Line endings Index: readme._tx =================================================================== RCS file: /cvsroot/ccomx/ccom/docs/readme._tx,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** readme._tx 21 Jun 2004 19:17:54 -0000 1.5 --- readme._tx 8 Nov 2004 21:16:37 -0000 1.6 *************** *** 1,216 **** ! @# This is the source for the CCOM readme file, in Allegro's custom format. ! @# Read allegro/docs/makedoc.c for a description of what is going on... ! @# ! @#ignore_css ! @multiwordheaders ! @document_title=CCOM readme ! @rtfh=Readme file of CCOM ! @$\input texinfo ! @$@setfilename readme.inf ! @$@settitle Readme of CCOM ! @$@setchapternewpage odd ! @$@paragraphindent 0 ! @$@setchapternewpage off ! @# This should remain commented at the moment (dvi output) @$@finalout ! @$ ! @$@ifinfo ! @$@direntry ! @$* Readme: (readme). Readme in CCOM ! @$@end direntry ! @$This is the Info version of the CCOM readme file. ! @$ ! @$By Christer Sandberg and Rasmus Myklebust ! @$@end ifinfo ! @$ ! @$@node Top, , (dir), (dir) ! @<html> ! @<head> ! @<title>Readme file of CCOM</title> ! @<body> ! <center><b>A CGUI and Allegro addon for serial port communication</b></center> ! <center><b>by Christer Sandberg and Rasmus Myklebust</b></center> ! <center>Email: <email>chr...@md...</a></center> ! <center>Homepage: <a href="http://www.idt.mdh.se/~csg/cgui/cguix">http://www.idt.mdh.se/~csg/cgui/cguix</a></center> ! <center><b> ! Readme file of CCOM ! </b></center> ! @!text ! @heading ! Contents ! ! @shortcontents ! ! @text ! @heading ! Introduction ! ! CCOM is a library with functions for sending and receiving data via the ! serial ports, using the event queue of CGUI. It also provides a dialogue ! that lets the user modify the port settings. ! ! CCOM builds and operates on the following platforms: DOS/DJGPP, Linux, ! Windows/Mingw32 and Windows/MSVC. ! ! @heading ! Requirements ! ! You need to have compiled and installed Allegro version 4.0.x, as well as ! CGUI vesion 1.6.7 or later. ! There are also other requirements like correctly installed compilers etc. ! but these are already fulfilled if you succeded in making and installing ! Allegro and CGUI (no additional requirements are needed). ! ! You can find Allegro at: ! http://alleg.sourceforge.net/ ! ! You can find CGUI at: ! http://www.mdh.se/~csg/cgui/ ! ! ! @heading ! Installation ! ! Installation goes in some simple steps, and should be familiar since it is ! similar to the installation procedure as of Allegro and CGUI: ! <ul> ! <li> ! Tell the installation process what platform you use. Start a command window ! (shell) and set the main directory of CCOM to you current directory ! i.e. enter the command ! <pre> ! cd c:\cbar ! </pre> ! or whatever is the name of your ccom directory. Then choose platform by ! running one of the following commands: ! <pre> ! fix.bat djgpp - to compile with DOS/DJGPP ! fix.bat mingw32 - to compile with Windows/MinGW32 ! fix.bat msvc - to compile with Windows/MSVC ! ./fix.sh unix - to compile with Linux/gcc ! </pre> ! <li> ! Specify the path to your allegro installation by setting the environment ! variable ALLEGRO. E.g. if your allegro directory is c:\allegro then ! you must type <br> ! <pre> ! set ALLEGRO=c:\allegro ! </pre> ! or alternatively put that line into your autoexec file and restart. ! For unix users: ! <pre> ! export ALLEGRO=/home/user/allegro-4.0.3 ! </pre> ! or whatever is the name of your allegro directory. ! <li> ! Specify the path to your CGUI installation by setting the environment ! CGUIDIR the same way as ALLEGRO, e.g.<br> ! <pre> ! set CGUIDIR=c:\cgui ! </pre> ! <pre> ! export CGUIDIR=/home/user/cgui ! </pre> ! <li> ! Ensure that all CGUI's tools has been built: ! Make CGUI's directory to the current, e.g. type the command ! <pre> ! cd c:\cgui ! </pre> ! Build: ! <pre> ! make dat2c ! make mktext ! </pre> ! Return to the main directory of cbar, e.g.: ! <pre> ! cd c:\ccom ! </pre> ! <li> ! Compile the library. This is done by running "make" at the command line. ! <li> ! Install the files to common directories. This is done by running ! "make install" at the command line.<br> ! Under Linux, you may want to instead run "make install SYSTEM_DIR=<dir>", ! which will cause headers to be installed to <dir>/include and libraries to ! <dir>/lib. (default for <dir> is /usr/local), or else you need to ! run make install as root. ! </ul> ! That's it! Now you are ready to run the example program in the example directory. ! <p> ! You may also want to perform some of the optional steps during the installation: ! <ul> ! <li> ! You can compile a debugging library by typing "make DEBUGMODE=1" instead of ! just "make" and "make install DEBUGMODE=1" instead of "make install". ! To compile both the usual and the debug library in one step, ! type "make all" and "make installall".<br> ! These debugging libraries require that you also have maked and installed ! the debugging versions of Allegro and CGUI. ! <li> ! If you want statically linked libraries under Unix or Windows as well as ! the default dynamically linked libraries (dll under Windows, .so under ! Unix), add "STATICLINK=1" to the make command like "make STATICLINK=1", ! or "make DEBUGMODE=1 STATICLINK=1" and also add it to the installation ! command.<br> ! These static libraries require that you also have maked and installed ! the static versions of Allegro and CGUI. ! <li> ! Users of the MSys environment needs to set teh environment vaariable ! UNIX_TOOLS to 1 before make install is run. ! <li> ! If you want to read the CCOM documentation with the Rhide online help ! system, go to the "Help / Syntax help / Files to search" menu in Rhide, ! and add "ccom" after the existing "libc" entry (separated by a space). ! <li> ! To use the ! To use the debugging library, link with libccomd.a instead of libccom.a. ! </ul> ! ! ! @heading ! Usage ! <ul><li> ! #include <ccom.h> in the top of each file that uses a function from ! the library. ! <li> ! Before calling any CCOM functions you must have initialized CGUI, Note! ! CGUI! For info about available functions, please read the manual, e.g. ! ccom.html (but the docs are also available in other formats). ! <li> ! If you link on the command line, link with '-lccom -lcgui -lalleg'. It is ! important that you specify the libraries in that order. If you want the ! ability to debug inside CCOM's functions, then link with '-lccomd' ! instead of '-lccom'. ! <p> ! On Linux you can use the following command to link with the default ! lib of CCOM (please note the ` ) ! <pre> ! gcc -s -lccom -lcgui `allegro-config --libs release --shared` file.o ! </pre> ! where `file' is the name of your file. <br> ! For debug libraries use -lccomd -lcguid instead and replace release ! with debug in the allegro config option. For linking a static application ! use -lccom_s and -lcgui_s and replace --shared with --static. ! <li> ! If you use the RHIDE environment, go to the menu Options/Libraries and ! fill in ccom. It is important that ccom is above cgui and allegro. Don't ! forget to check the box to the left of the library. You have to replace ! ccom with ccomd to include debugging information. ! <li> ! If you use some other environment, there is probably some options dialog ! where you can enter the libraries names (e.g. -lccom -lcgui -lalleg). ! </ul> ! ! ! @heading ! Contact Info ! ! Email:<ul> ! chr...@md... ! </ul> ! Homepage:<ul> ! http://www.idt.mdh.se/~csg/cgui/cguix ! </ul> ! Telephone:<ul> ! +46.(0)21.38.10.66 ! </ul> --- 1,216 ---- ! @# This is the source for the CCOM readme file, in Allegro's custom format. ! @# Read allegro/docs/makedoc.c for a description of what is going on... ! @# ! @#ignore_css ! @multiwordheaders ! @document_title=CCOM readme ! @rtfh=Readme file of CCOM ! @$\input texinfo ! @$@setfilename readme.inf ! @$@settitle Readme of CCOM ! @$@setchapternewpage odd ! @$@paragraphindent 0 ! @$@setchapternewpage off ! @# This should remain commented at the moment (dvi output) @$@finalout ! @$ ! @$@ifinfo ! @$@direntry ! @$* Readme: (readme). Readme in CCOM ! @$@end direntry ! @$This is the Info version of the CCOM readme file. ! @$ ! @$By Christer Sandberg and Rasmus Myklebust ! @$@end ifinfo ! @$ ! @$@node Top, , (dir), (dir) ! @<html> ! @<head> ! @<title>Readme file of CCOM</title> ! @<body> ! <center><b>A CGUI and Allegro addon for serial port communication</b></center> ! <center><b>by Christer Sandberg and Rasmus Myklebust</b></center> ! <center>Email: <email>chr...@md...</a></center> ! <center>Homepage: <a href="http://www.idt.mdh.se/~csg/cgui/cguix">http://www.idt.mdh.se/~csg/cgui/cguix</a></center> ! <center><b> ! Readme file of CCOM ! </b></center> ! @!text ! @heading ! Contents ! ! @shortcontents ! ! @text ! @heading ! Introduction ! ! CCOM is a library with functions for sending and receiving data via the ! serial ports, using the event queue of CGUI. It also provides a dialogue ! that lets the user modify the port settings. ! ! CCOM builds and operates on the following platforms: DOS/DJGPP, Linux, ! Windows/Mingw32 and Windows/MSVC. ! ! @heading ! Requirements ! ! You need to have compiled and installed Allegro version 4.0.x, as well as ! CGUI vesion 1.6.7 or later. ! There are also other requirements like correctly installed compilers etc. ! but these are already fulfilled if you succeded in making and installing ! Allegro and CGUI (no additional requirements are needed). ! ! You can find Allegro at: ! http://alleg.sourceforge.net/ ! ! You can find CGUI at: ! http://www.mdh.se/~csg/cgui/ ! ! ! @heading ! Installation ! ! Installation goes in some simple steps, and should be familiar since it is ! similar to the installation procedure as of Allegro and CGUI: ! <ul> ! <li> ! Tell the installation process what platform you use. Start a command window ! (shell) and set the main directory of CCOM to you current directory ! i.e. enter the command ! <pre> ! cd c:\cbar ! </pre> ! or whatever is the name of your ccom directory. Then choose platform by ! running one of the following commands: ! <pre> ! fix.bat djgpp - to compile with DOS/DJGPP ! fix.bat mingw32 - to compile with Windows/MinGW32 ! fix.bat msvc - to compile with Windows/MSVC ! ./fix.sh unix - to compile with Linux/gcc ! </pre> ! <li> ! Specify the path to your allegro installation by setting the environment ! variable ALLEGRO. E.g. if your allegro directory is c:\allegro then ! you must type <br> ! <pre> ! set ALLEGRO=c:\allegro ! </pre> ! or alternatively put that line into your autoexec file and restart. ! For unix users: ! <pre> ! export ALLEGRO=/home/user/allegro-4.0.3 ! </pre> ! or whatever is the name of your allegro directory. ! <li> ! Specify the path to your CGUI installation by setting the environment ! CGUIDIR the same way as ALLEGRO, e.g.<br> ! <pre> ! set CGUIDIR=c:\cgui ! </pre> ! <pre> ! export CGUIDIR=/home/user/cgui ! </pre> ! <li> ! Ensure that all CGUI's tools has been built: ! Make CGUI's directory to the current, e.g. type the command ! <pre> ! cd c:\cgui ! </pre> ! Build: ! <pre> ! make dat2c ! make mktext ! </pre> ! Return to the main directory of cbar, e.g.: ! <pre> ! cd c:\ccom ! </pre> ! <li> ! Compile the library. This is done by running "make" at the command line. ! <li> ! Install the files to common directories. This is done by running ! "make install" at the command line.<br> ! Under Linux, you may want to instead run "make install SYSTEM_DIR=<dir>", ! which will cause headers to be installed to <dir>/include and libraries to ! <dir>/lib. (default for <dir> is /usr/local), or else you need to ! run make install as root. ! </ul> ! That's it! Now you are ready to run the example program in the example directory. ! <p> ! You may also want to perform some of the optional steps during the installation: ! <ul> ! <li> ! You can compile a debugging library by typing "make DEBUGMODE=1" instead of ! just "make" and "make install DEBUGMODE=1" instead of "make install". ! To compile both the usual and the debug library in one step, ! type "make all" and "make installall".<br> ! These debugging libraries require that you also have maked and installed ! the debugging versions of Allegro and CGUI. ! <li> ! If you want statically linked libraries under Unix or Windows as well as ! the default dynamically linked libraries (dll under Windows, .so under ! Unix), add "STATICLINK=1" to the make command like "make STATICLINK=1", ! or "make DEBUGMODE=1 STATICLINK=1" and also add it to the installation ! command.<br> ! These static libraries require that you also have maked and installed ! the static versions of Allegro and CGUI. ! <li> ! Users of the MSys environment needs to set teh environment vaariable ! UNIX_TOOLS to 1 before make install is run. ! <li> ! If you want to read the CCOM documentation with the Rhide online help ! system, go to the "Help / Syntax help / Files to search" menu in Rhide, ! and add "ccom" after the existing "libc" entry (separated by a space). ! <li> ! To use the ! To use the debugging library, link with libccomd.a instead of libccom.a. ! </ul> ! ! ! @heading ! Usage ! <ul><li> ! #include <ccom.h> in the top of each file that uses a function from ! the library. ! <li> ! Before calling any CCOM functions you must have initialized CGUI, Note! ! CGUI! For info about available functions, please read the manual, e.g. ! ccom.html (but the docs are also available in other formats). ! <li> ! If you link on the command line, link with '-lccom -lcgui -lalleg'. It is ! important that you specify the libraries in that order. If you want the ! ability to debug inside CCOM's functions, then link with '-lccomd' ! instead of '-lccom'. ! <p> ! On Linux you can use the following command to link with the default ! lib of CCOM (please note the ` ) ! <pre> ! gcc -s -lccom -lcgui `allegro-config --libs release --shared` file.o ! </pre> ! where `file' is the name of your file. <br> ! For debug libraries use -lccomd -lcguid instead and replace release ! with debug in the allegro config option. For linking a static application ! use -lccom_s and -lcgui_s and replace --shared with --static. ! <li> ! If you use the RHIDE environment, go to the menu Options/Libraries and ! fill in ccom. It is important that ccom is above cgui and allegro. Don't ! forget to check the box to the left of the library. You have to replace ! ccom with ccomd to include debugging information. ! <li> ! If you use some other environment, there is probably some options dialog ! where you can enter the libraries names (e.g. -lccom -lcgui -lalleg). ! </ul> ! ! ! @heading ! Contact Info ! ! Email:<ul> ! chr...@md... ! </ul> ! Homepage:<ul> ! http://www.idt.mdh.se/~csg/cgui/cguix ! </ul> ! Telephone:<ul> ! +46.(0)21.38.10.66 ! </ul> Index: ccom._tx =================================================================== RCS file: /cvsroot/ccomx/ccom/docs/ccom._tx,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ccom._tx 21 Jun 2004 19:17:54 -0000 1.6 --- ccom._tx 8 Nov 2004 21:16:37 -0000 1.7 *************** *** 1,238 **** ! @#This is the source for the CCOM manual, in Shawn's special format. ! @#The readable documents are generated and will be found in the files: ! @#ccom.txt,ccom.rtf, ccom.htm, ccom.inf, the latter may be ! @#installed as on-line help if you are using rhide (just add cbarcode to the ! @#list of help files) ! @# ! @multiwordheaders ! @manh="version 0.9.2" "CCOM" "Manual" ! @document_title=CCOM Manual ! @rtfh=CCOM - an add on lib to CGUI for accessing the serial ports ! @$\input texinfo ! @$@setfilename ccom.inf ! @$@settitle CCOM Manual ! @$@setchapternewpage odd ! @$@paragraphindent 0 ! @$ ! @$@ifinfo ! @$This is the Info version of the CCOM manual ! @$ ! @$By Christer Sandberg and Rasmus Myklebust ! @$@end ifinfo ! @$ ! @$@node Top, , (dir), (dir) ! @<html> ! @<head> ! @<title>The CCOM API</title> ! @<body> ! <center><b>CCOM</b></center> ! <center><b>A CGUI and Allegro addon Communication package</b></center> ! <center><b>by Christer Sandberg and Rasmus Myklebust</b></center> ! <center>Email: <email>chr...@md...</a></center> ! <center>Homepage: <a href="http://www.idt.mdh.se/~csg/cgui/cguix">http://www.idt.mdh.se/~csg/cgui/cguix</a></center> ! <center><b> ! The Manual of CCOM 0.9.2 ! </b></center> ! @!text ! ! @heading ! Contents ! ! @contents ! ! @text ! @heading ! Using CCOM ! @xref Simple use of COM ports ! @xref Direct_port_setting ! To be able to call the functions in the CCOM lib you must first build and ! install the lib and then #include <ccom.h> in your C file(s). You must ! also link to the lib libcgui.a (or use the dynamic linked module). When ! you run your program you must also ensure that the text labels for the ! dialogue rea present (don't forget this when you distribute your program ! to other people!). You can find that file in the examples directory of ! CCOM. ! ! @heading ! Simple use of COM ports ! @xref Direct_port_setting ! A "serial port" is a chip in the computer with two sides, one "speaking" to ! the CPU (i.e. your program), the other sending data to and receiving data ! from some device connected to the plug at the back of the computer. ! The transmission of data on the line can be done in different manners, ! the sender and receiver must always agree on which manner. The current ! hardware is not able to do anything like "auto-detection". Therefore ! the port must be informed how to transmit data to and from the ! currently connected device. These "port settings" must be set from the "CPU ! side" of the port, i.e. your program must do it. Only the end user of your ! program knows what device that is connected to his or her computer for the ! moment. Therefore the task is quite simple for you: Provide the end-user ! with some kind of dialogue to enter the port settings. When the settings has ! been chosen the port must be informed about these settings. <br> ! The major tasks for CCOM are: ! <ul> ! <li> provide such a dialogue ! <li> hide details about how to tell the port about these settings ! <li> hide details about how to send and receive data ! </ul> ! To send data you just call the send-function. To be able to receive data ! you need to call another function to "register" a call-back (a pointer to ! some function that you have written) that will be called as soon as some ! data has reached the port from the outside world.<br> ! ! @@int @CcomSettingsDialogue(int portnr); ! Starts a dialogue which let the user modify the port settings. If the ! user confirms the changes made (by closing the dialogue with ! "OK"), the new settings will immediately be applied to the hardware and ! also stored into the config-file. <br> ! Parameter: ! <ul> ! <li> portnr: the port number (CCOM_COM1, CCOM_COM2, CCOM_COM3, CCOM_COM4) to ! modify settings for. ! </ul> ! Returns 1 if successful else 0. ! ! @@int @CcomSendBuffer(int portnr, const char *buffer, int n, void (*Notify) (int portnr, void *data), void *data); ! Starts the sending of the buffer `buffer' to port `portnr'. ! If the previous buffer(s) has not yet been sent, `CcomSendBuffer' will ! enque the new buffer. The first time ! `CcomStartScanning' or `CcomSendBuffer' is called for a certain port the ! port settings will be loaded from the current config file.<br> ! <ul> ! <li> portnr: The port number (CCOM_COM*) to send the buffer to ! <li> buffer: The data to send. A copy of `buffer' will be made so ! you are free to destroy your calling buffer. ! <li> n: The number of bytes to send. ! <li> Notify: (optional) A pointer to a function of yours, that will ! be called when the buffer has been successfully sent. If you don't ! need any notification, just pass NULL.<br> ! `Notify' is associated with the current buffer only so, if you want, ! you may alter both the call-back and data-pointer between different ! buffers. ! Parameters to `Notify': ! <ul> ! <li> portnr: The port that the data was sent on. ! <li> data: The pointer `data' passed to `CcomSendBuffer'. ! </ul> ! <li> data: A pointer to some data that will be passed to `Notify', pass ! NULL if you don't need it. ! </ul> ! Returns 1 if successful else 0. ! ! @@int @CcomStartScanning(int portnr, int options, void (*CallBack) (int portnr, int readdata, int error, void *data), void *data); ! Starts to check the port `portno' for bytes. The first time ! `CcomStartScanning' or `CcomSendBuffer' is called for a certain port the ! port settings will be loaded from the current config file. ! <ul> ! <li> portnr: The port number (CCOM_COM*) to receive bytes from. ! <li> CallBack: A pointer to a function of yours that will ! be called as soon as a byte has been received. <br> ! Parameters to `CallBack': ! <ul> ! <li> portnr: The port where the data was received ! <li> options: Currently not used. ! <li> readdata: The the low-order byte of `readdata' contains ! the byte read from the port. ! <li> error: If a transmission error was detected, then this ! error code will be passed in `error'. The possible errors are: ! <ul> ! <li> CCOM_ERR_ORUN - Overrun, may occure if polling is used and ! the progam is not fast enough to check the port. ! <li> CCOM_ERR_PAR - Parity error, may occure if there is a bad ! line or the port settings is not the same on receiving ! computer and the sending device. ! <li> CCOM_ERR_FRAME - Frame error, may occure if there is a bad ! line or the port settings is not the same on receiving ! computer and the sending device. ! </ul> ! <li> data: The pointer `data' passed to `CcomStartScanning'. ! </ul> ! <li> data: A pointer to some data that will be passed to `CallBack', pass ! NULL if you don't need it. ! </ul> ! Returns 1 if successful else 0. ! ! @@int @CcomStopSending(int portno) ! Normally you don't need to use this function. `CcomStopSending' will stop ! the sending. Buffers that are unsent (partially or completetly) ! will be dropped. ! Returns 1 if successful else 0. ! ! @@int @CcomStopScanning(int portno); ! Normally you don't need to use this function. `CcomStopScanning' will stop ! scanning (checking the port for incoming data). ! Returns 1 if successful else 0. ! ! @@void @CcomSetPath(const char *path); ! It's not necessary to use this function. The dialogue will look for the ! file with textlabels in the current directory (i.e. it will try to open ! "ccomlabl.txt"). I you prefere locating that file somewhere else you can ! can use `CcomSetPath' to specify that path. The path must include also the ! file name. The path may lead to somewhere in a datafile if you use the ! '#' delimiter after the data-file name (as usual). ! In the distribution of CCOM the text-file is located in the examples ! directory. It can be re-built by use of the `mktext' tool of CGUI (see ! the tools directory of CGUI for details about the tool). Enter the ! command `make texts CGUIDIR=<path>' where <path> is the path to your ! CGUI directory. To add labels of your favorite language to the label file ! do these additions into file src/*.t and re-build. If you do it, it would ! also be fine if you send me the changes so I can add them to next release! ! ! @heading ! Direct_port_setting ! @xref Simple use of COM ports ! If you for some reason don't like the dialogue for port settings, you can ! make your own and instead use the direct port setting functions.<br> ! In some cases you may want to do a program for computer-computer ! communication, then it may in some cases be meaningful to hard-code the ! port settings, in which case the direct port setting functions can be used. ! In most cases it will however not be meaningful to hard-code the settings of ! the port. ! ! @@int @CcomSetBaud(int portno, long baud_rate); ! Normally you dont need to call this function. ! Modifies the port setting concerning the transmission speed. If you call ! this function you must call it after the first call to `CcomStartScanning' ! or `CcomSendBuffer'. ! Returns 1 if successful else 0. ! ! @@int @CcomSetBits(int portno, int nrbits); ! Normally you dont need to call this function. ! Modifies the port setting concerning number of bits in each byte. `nrbits' ! can range from 5 to 8. If you use this function you must call it after ! the first call to `CcomStartScanning' or `CcomSendBuffer'. ! Returns 1 if successful else 0. ! ! @@int @CcomSetStopBits(int portno, int stopbits); ! Normally you dont need to call this function. ! Modifies the port setting concerning stopbits. `stopbits' can be either 1 ! or 2. If you use this function you must call it after the first call ! to `CcomStartScanning' or `CcomSendBuffer'. ! Returns 1 if successful else 0. ! ! @@int @CcomSetParity(int portno, int parity); ! Normally you dont need to call this function. ! Modifies the port setting concerning parity. If `parity' is ! 1 the parity check will be "even", if 0 odd. If you use this function ! you must call it after the first call to `CcomStartScanning' or ! `CcomSendBuffer'. ! Returns 1 if successful else 0. ! ! @@int @CcomSetParityEnable(int portno, int parityenable); ! Normally you dont need to call this function. ! Modifies the port setting concerning parity enable. If `parityenable' is ! 1 the parity check will be enabled, if 0 disabled. If you use this ! function you must call it after the first call to `CcomStartScanning' or ! `CcomSendBuffer'. ! Returns 1 if successful else 0. ! ! @headingnocontent ! Index ! ! @index ! ! @$@contents ! @$@bye ! ! @html ! @text --- 1,238 ---- ! @#This is the source for the CCOM manual, in Shawn's special format. ! @#The readable documents are generated and will be found in the files: ! @#ccom.txt,ccom.rtf, ccom.htm, ccom.inf, the latter may be ! @#installed as on-line help if you are using rhide (just add cbarcode to the ! @#list of help files) ! @# ! @multiwordheaders ! @manh="version 0.9.2" "CCOM" "Manual" ! @document_title=CCOM Manual ! @rtfh=CCOM - an add on lib to CGUI for accessing the serial ports ! @$\input texinfo ! @$@setfilename ccom.inf ! @$@settitle CCOM Manual ! @$@setchapternewpage odd ! @$@paragraphindent 0 ! @$ ! @$@ifinfo ! @$This is the Info version of the CCOM manual ! @$ ! @$By Christer Sandberg and Rasmus Myklebust ! @$@end ifinfo ! @$ ! @$@node Top, , (dir), (dir) ! @<html> ! @<head> ! @<title>The CCOM API</title> ! @<body> ! <center><b>CCOM</b></center> ! <center><b>A CGUI and Allegro addon Communication package</b></center> ! <center><b>by Christer Sandberg and Rasmus Myklebust</b></center> ! <center>Email: <email>chr...@md...</a></center> ! <center>Homepage: <a href="http://www.idt.mdh.se/~csg/cgui/cguix">http://www.idt.mdh.se/~csg/cgui/cguix</a></center> ! <center><b> ! The Manual of CCOM 0.9.2 ! </b></center> ! @!text ! ! @heading ! Contents ! ! @contents ! ! @text ! @heading ! Using CCOM ! @xref Simple use of COM ports ! @xref Direct_port_setting ! To be able to call the functions in the CCOM lib you must first build and ! install the lib and then #include <ccom.h> in your C file(s). You must ! also link to the lib libcgui.a (or use the dynamic linked module). When ! you run your program you must also ensure that the text labels for the ! dialogue rea present (don't forget this when you distribute your program ! to other people!). You can find that file in the examples directory of ! CCOM. ! ! @heading ! Simple use of COM ports ! @xref Direct_port_setting ! A "serial port" is a chip in the computer with two sides, one "speaking" to ! the CPU (i.e. your program), the other sending data to and receiving data ! from some device connected to the plug at the back of the computer. ! The transmission of data on the line can be done in different manners, ! the sender and receiver must always agree on which manner. The current ! hardware is not able to do anything like "auto-detection". Therefore ! the port must be informed how to transmit data to and from the ! currently connected device. These "port settings" must be set from the "CPU ! side" of the port, i.e. your program must do it. Only the end user of your ! program knows what device that is connected to his or her computer for the ! moment. Therefore the task is quite simple for you: Provide the end-user ! with some kind of dialogue to enter the port settings. When the settings has ! been chosen the port must be informed about these settings. <br> ! The major tasks for CCOM are: ! <ul> ! <li> provide such a dialogue ! <li> hide details about how to tell the port about these settings ! <li> hide details about how to send and receive data ! </ul> ! To send data you just call the send-function. To be able to receive data ! you need to call another function to "register" a call-back (a pointer to ! some function that you have written) that will be called as soon as some ! data has reached the port from the outside world.<br> ! ! @@int @CcomSettingsDialogue(int portnr); ! Starts a dialogue which let the user modify the port settings. If the ! user confirms the changes made (by closing the dialogue with ! "OK"), the new settings will immediately be applied to the hardware and ! also stored into the config-file. <br> ! Parameter: ! <ul> ! <li> portnr: the port number (CCOM_COM1, CCOM_COM2, CCOM_COM3, CCOM_COM4) to ! modify settings for. ! </ul> ! Returns 1 if successful else 0. ! ! @@int @CcomSendBuffer(int portnr, const char *buffer, int n, void (*Notify) (int portnr, void *data), void *data); ! Starts the sending of the buffer `buffer' to port `portnr'. ! If the previous buffer(s) has not yet been sent, `CcomSendBuffer' will ! enque the new buffer. The first time ! `CcomStartScanning' or `CcomSendBuffer' is called for a certain port the ! port settings will be loaded from the current config file.<br> ! <ul> ! <li> portnr: The port number (CCOM_COM*) to send the buffer to ! <li> buffer: The data to send. A copy of `buffer' will be made so ! you are free to destroy your calling buffer. ! <li> n: The number of bytes to send. ! <li> Notify: (optional) A pointer to a function of yours, that will ! be called when the buffer has been successfully sent. If you don't ! need any notification, just pass NULL.<br> ! `Notify' is associated with the current buffer only so, if you want, ! you may alter both the call-back and data-pointer between different ! buffers. ! Parameters to `Notify': ! <ul> ! <li> portnr: The port that the data was sent on. ! <li> data: The pointer `data' passed to `CcomSendBuffer'. ! </ul> ! <li> data: A pointer to some data that will be passed to `Notify', pass ! NULL if you don't need it. ! </ul> ! Returns 1 if successful else 0. ! ! @@int @CcomStartScanning(int portnr, int options, void (*CallBack) (int portnr, int readdata, int error, void *data), void *data); ! Starts to check the port `portno' for bytes. The first time ! `CcomStartScanning' or `CcomSendBuffer' is called for a certain port the ! port settings will be loaded from the current config file. ! <ul> ! <li> portnr: The port number (CCOM_COM*) to receive bytes from. ! <li> CallBack: A pointer to a function of yours that will ! be called as soon as a byte has been received. <br> ! Parameters to `CallBack': ! <ul> ! <li> portnr: The port where the data was received ! <li> options: Currently not used. ! <li> readdata: The the low-order byte of `readdata' contains ! the byte read from the port. ! <li> error: If a transmission error was detected, then this ! error code will be passed in `error'. The possible errors are: ! <ul> ! <li> CCOM_ERR_ORUN - Overrun, may occure if polling is used and ! the progam is not fast enough to check the port. ! <li> CCOM_ERR_PAR - Parity error, may occure if there is a bad ! line or the port settings is not the same on receiving ! computer and the sending device. ! <li> CCOM_ERR_FRAME - Frame error, may occure if there is a bad ! line or the port settings is not the same on receiving ! computer and the sending device. ! </ul> ! <li> data: The pointer `data' passed to `CcomStartScanning'. ! </ul> ! <li> data: A pointer to some data that will be passed to `CallBack', pass ! NULL if you don't need it. ! </ul> ! Returns 1 if successful else 0. ! ! @@int @CcomStopSending(int portno) ! Normally you don't need to use this function. `CcomStopSending' will stop ! the sending. Buffers that are unsent (partially or completetly) ! will be dropped. ! Returns 1 if successful else 0. ! ! @@int @CcomStopScanning(int portno); ! Normally you don't need to use this function. `CcomStopScanning' will stop ! scanning (checking the port for incoming data). ! Returns 1 if successful else 0. ! ! @@void @CcomSetPath(const char *path); ! It's not necessary to use this function. The dialogue will look for the ! file with textlabels in the current directory (i.e. it will try to open ! "ccomlabl.txt"). I you prefere locating that file somewhere else you can ! can use `CcomSetPath' to specify that path. The path must include also the ! file name. The path may lead to somewhere in a datafile if you use the ! '#' delimiter after the data-file name (as usual). ! In the distribution of CCOM the text-file is located in the examples ! directory. It can be re-built by use of the `mktext' tool of CGUI (see ! the tools directory of CGUI for details about the tool). Enter the ! command `make texts CGUIDIR=<path>' where <path> is the path to your ! CGUI directory. To add labels of your favorite language to the label file ! do these additions into file src/*.t and re-build. If you do it, it would ! also be fine if you send me the changes so I can add them to next release! ! ! @heading ! Direct_port_setting ! @xref Simple use of COM ports ! If you for some reason don't like the dialogue for port settings, you can ! make your own and instead use the direct port setting functions.<br> ! In some cases you may want to do a program for computer-computer ! communication, then it may in some cases be meaningful to hard-code the ! port settings, in which case the direct port setting functions can be used. ! In most cases it will however not be meaningful to hard-code the settings of ! the port. ! ! @@int @CcomSetBaud(int portno, long baud_rate); ! Normally you dont need to call this function. ! Modifies the port setting concerning the transmission speed. If you call ! this function you must call it after the first call to `CcomStartScanning' ! or `CcomSendBuffer'. ! Returns 1 if successful else 0. ! ! @@int @CcomSetBits(int portno, int nrbits); ! Normally you dont need to call this function. ! Modifies the port setting concerning number of bits in each byte. `nrbits' ! can range from 5 to 8. If you use this function you must call it after ! the first call to `CcomStartScanning' or `CcomSendBuffer'. ! Returns 1 if successful else 0. ! ! @@int @CcomSetStopBits(int portno, int stopbits); ! Normally you dont need to call this function. ! Modifies the port setting concerning stopbits. `stopbits' can be either 1 ! or 2. If you use this function you must call it after the first call ! to `CcomStartScanning' or `CcomSendBuffer'. ! Returns 1 if successful else 0. ! ! @@int @CcomSetParity(int portno, int parity); ! Normally you dont need to call this function. ! Modifies the port setting concerning parity. If `parity' is ! 1 the parity check will be "even", if 0 odd. If you use this function ! you must call it after the first call to `CcomStartScanning' or ! `CcomSendBuffer'. ! Returns 1 if successful else 0. ! ! @@int @CcomSetParityEnable(int portno, int parityenable); ! Normally you dont need to call this function. ! Modifies the port setting concerning parity enable. If `parityenable' is ! 1 the parity check will be enabled, if 0 disabled. If you use this ! function you must call it after the first call to `CcomStartScanning' or ! `CcomSendBuffer'. ! Returns 1 if successful else 0. ! ! @headingnocontent ! Index ! ! @index ! ! @$@contents ! @$@bye ! ! @html ! @text |
|
From: Rasmus M. <ras...@us...> - 2004-11-08 21:15:32
|
Update of /cvsroot/ccomx/ccom/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv956 Modified Files: makefile.all makefile.bcc makefile.dj makefile.mgw makefile.uni makefile.vc makefile.ver Log Message: Line endings Index: makefile.uni =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/makefile.uni,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** makefile.uni 21 Jun 2004 19:17:54 -0000 1.4 --- makefile.uni 8 Nov 2004 21:15:21 -0000 1.5 *************** *** 1,226 **** ! # makefile.uni: ! # Makefile for the CCOM library with Unix. Should not be used directly! ! # ! # By Christer Sandberg (copied from ADIME made by Sven Sandberg) ! # See readme.txt for more information about CCOM. ! # See makefile.all for a list of the available targets. ! ! # -------- Define some variables that the primary makefile may use. -------- ! ! PLATFORM = UNIX ! ! EXE_SUFFIX = ! OBJ_SUFFIX = .o ! LIB_SUFFIX = .a ! HTML_SUFFIX = .html ! INFO_SUFFIX = .info ! TEXI_SUFFIX = .texi ! ! _TX_HTML_FLAG = -html ! _TX_TEXI_FLAG = -texi ! ! ifndef OBJ_ROOT_DIR ! OBJ_ROOT_DIR = obj ! endif ! OBJ_PLATFORM_ROOT_DIR = $(OBJ_ROOT_DIR)/unix ! ! ifndef LIB_ROOT_DIR ! LIB_ROOT_DIR = lib ! endif ! LIB_DIR = $(LIB_ROOT_DIR)/unix ! ! HAVE_TEXINFO = 1 ! ! ifdef STATICLINK # link as a static library ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE)_s ! IMPLIB_BASENAME = lib$(PACKAGE)_s.a ! else # link as a shared object ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE) ! IMPLIB_BASENAME = lib$(PACKAGE).so ! endif ! ! IMPLIB_NAME = $(LIB_DIR)/$(IMPLIB_BASENAME) ! LIB_NAME = $(IMPLIB_NAME) ! ! # -------- Default system paths. ------------ ! ! ifndef SYSTEM_DIR ! SYSTEM_DIR = /usr/local ! endif ! SYSTEM_INCLUDE_DIR = $(SYSTEM_DIR)/include ! SYSTEM_LIB_DIR = $(SYSTEM_DIR)/lib ! ! # -------- Set up mktext -------- ! ALLEGRO_DAT = $(ALLEGRO_DAT_X) ! CGUI_DAT2C = $(CGUI_DAT2C_X) ! CCOM_DAT = $(CCOM_DAT_X) ! CCOM_DAT_C = $(CCOM_DAT_C_X) ! CCOM_DAT_H = $(CCOM_DAT_H_X) ! CCOM_LABELS = $(CCOM_LABELS_X) ! TEXT_SOURCES = $(TEXT_SOURCES_X) ! TEXT_HEADERS = $(TEXT_HEADERS_X) ! MKTEXT = $(MKTEXT_X) ! ! # -------- Give a sensible default target for make without any args. -------- ! # This must be done right after the tests, which can generate error targets. ! ! .PHONY: _default ! ! _default: default ! ! # -------- Decide what compiler options and libraries to use. -------- ! ! ifdef WARNMODE ! WFLAGS = -Wall -W -Werror ! else ! WFLAGS = -Wall -Wno-unused ! endif ! ! ifdef PGCC ! OFLAGS = -mcpu=pentium -O6 -ffast-math ! else ! ifdef PENTIUMONLY ! OFLAGS = -march=pentium -O2 -funroll-loops -ffast-math ! else ! OFLAGS = -mcpu=pentium -O2 -funroll-loops -ffast-math ! endif ! endif ! ! ifdef STATICLINK ! ALLEGRO_CONFIG_FLAGS = --static ! LIB_FLAGS = -lcgui_s ! else ! ALLEGRO_CONFIG_FLAGS = --shared ! LIB_FLAGS = -lcgui ! endif ! ! ifdef DEBUGMODE ! # debugging build ! CFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) -g ! SFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) ! LFLAGS += -g ! LIB_FLAGS += `allegro-config --libs debug $(ALLEGRO_CONFIG_FLAGS)` ! else ! ifdef PROFILEMODE ! # profiling build ! CFLAGS = $(WFLAGS) $(OFLAGS) -pg ! SFLAGS = $(WFLAGS) ! LFLAGS += -pg ! LIB_FLAGS += `allegro-config --libs profile $(ALLEGRO_CONFIG_FLAGS)` ! else ! # optimised build ! CFLAGS = $(WFLAGS) $(OFLAGS) -fomit-frame-pointer -fno-strength-reduce ! SFLAGS = $(WFLAGS) ! ifndef SYMBOLMODE ! LFLAGS += -s ! LIB_FLAGS += `allegro-config --libs release $(ALLEGRO_CONFIG_FLAGS)` ! endif ! endif ! endif ! ! ifdef CCOM_DEVELOPING ! CFLAGS += -D_CCOM_DEVELOPING=1 ! endif ! ifdef CCOM_FORTIFY ! CFLAGS += -D_CCOM_FORTIFY=1 -DFORTIFY ! endif ! ! CFLAGS_NO_OPTIMIZE = $(WFLAGS) ! ! COMPILE_FLAGS = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS) ! COMPILE_FLAGS_NO_OPTIMIZE = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS_NO_OPTIMIZE) ! ! ifdef STATICLINK ! COMPILE_FLAGS += -DCCOM_STATICLINK ! endif ! ! ifdef PROFILEMODE ! LIB_FLAGS += -lgmon ! endif ! ! # -------- List platform specific objects and programs. -------- ! ! VPATH += ! ! OBJ_LIST = $(COMMON_OBJS) ! ! # Insert names of targets to build platform specific programs here. ! PROGRAMS = ! # Insert targets to build platform specific programs here. ! # myprogram: path/myprogram$(EXE_SUFFIX) ! ! # -------- Define how to compile. -------- ! ! GCC2UNIX = -D__UNIX__ -UDJGPP ! ! define COMPILE_C_TO_OBJ ! gcc $(COMPILE_FLAGS) -I./include -o $@ -c $< ! endef ! ! ifdef STATICLINK ! # link as a static library ! define LINK_OBJ_TO_LIB ! ar rs $(LIB_NAME) $(LIB_OBJS) ! endef ! ! define LINK_OBJ_TO_EXE ! gcc $(LFLAGS) -o $@ $< $(IMPLIB_NAME) $(LIB_FLAGS) ! endef ! else ! # link as a shared object ! define LINK_OBJ_TO_LIB ! gcc $(LFLAGS) -shared -o $(IMPLIB_NAME) $(LIB_OBJS) $(LIB_FLAGS) ! endef ! ! define LINK_OBJ_TO_EXE ! gcc $(LFLAGS) -o $@ $< -L$(LIB_DIR) -lccom $(LIB_FLAGS) ! endef ! endif ! ! # -------- Rules for installing and removing the library files. -------- ! ! # If you don't have the install command, you may use cp and mkdir, but ! # this will not set permissions. ! ! $(SYSTEM_LIB_DIR)/$(IMPLIB_BASENAME): $(IMPLIB_NAME) ! install -m 755 -d $(SYSTEM_LIB_DIR) ! install -m 644 $< $@ ! ! $(SYSTEM_INCLUDE_DIR)/ccom.h: include/ccom.h ! install -m 755 -d $(SYSTEM_INCLUDE_DIR) ! install -m 644 $< $@ ! ! $(SYSTEM_INCLUDE_DIR)/ccom/%.h: include/ccom/%.h include/ccom ! install -m 755 -d $(SYSTEM_INCLUDE_DIR)/ccom ! install -m 644 $< $@ ! ! ! INSTALL_HEADERS = $(addprefix $(SYSTEM_DIR)/,$(wildcard include/ccom/*.h)) ! ! INSTALL_FILES = $(SYSTEM_LIB_DIR)/$(IMPLIB_BASENAME) \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(INSTALL_HEADERS) ! ! install: $(INSTALL_FILES) ! @echo The $(DESCRIPTION) UNIX library has been installed. ! ! UNINSTALL_FILES = $(SYSTEM_LIB_DIR)/libccom_s.a $(SYSTEM_LIB_DIR)/libccomd_s.a \ ! $(SYSTEM_LIB_DIR)/libccom.so $(SYSTEM_LIB_DIR)/libccomd.so \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h ! ! uninstall: ! -rm -fv $(UNINSTALL_FILES) ! -rm -frv $(SYSTEM_INCLUDE_DIR)/ccom ! @echo All gone! ! ! # -------- generate automatic dependencies -------- ! ! DEPEND_PARAMS = $(GCC2UNIX) -MM -MG -I./include -DCCOM_SCAN_DEPEND ! ! depend: ! gcc $(DEPEND_PARAMS) src/*.c examples/*.c > _depend.tmp ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/unix\/ccom\/\1\.o:/" _depend.tmp > obj/unix/ccom/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/unix\/ccomd\/\1\.o:/" _depend.tmp > obj/unix/ccomd/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/unix\/ccom_s\/\1\.o:/" _depend.tmp > obj/unix/ccom_s/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/unix\/ccomd_s\/\1\.o:/" _depend.tmp > obj/unix/ccomd_s/makefile.dep ! rm _depend.tmp --- 1,226 ---- ! # makefile.uni: ! # Makefile for the CCOM library with Unix. Should not be used directly! ! # ! # By Christer Sandberg (copied from ADIME made by Sven Sandberg) ! # See readme.txt for more information about CCOM. ! # See makefile.all for a list of the available targets. ! ! # -------- Define some variables that the primary makefile may use. -------- ! ! PLATFORM = UNIX ! ! EXE_SUFFIX = ! OBJ_SUFFIX = .o ! LIB_SUFFIX = .a ! HTML_SUFFIX = .html ! INFO_SUFFIX = .info ! TEXI_SUFFIX = .texi ! ! _TX_HTML_FLAG = -html ! _TX_TEXI_FLAG = -texi ! ! ifndef OBJ_ROOT_DIR ! OBJ_ROOT_DIR = obj ! endif ! OBJ_PLATFORM_ROOT_DIR = $(OBJ_ROOT_DIR)/unix ! ! ifndef LIB_ROOT_DIR ! LIB_ROOT_DIR = lib ! endif ! LIB_DIR = $(LIB_ROOT_DIR)/unix ! ! HAVE_TEXINFO = 1 ! ! ifdef STATICLINK # link as a static library ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE)_s ! IMPLIB_BASENAME = lib$(PACKAGE)_s.a ! else # link as a shared object ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE) ! IMPLIB_BASENAME = lib$(PACKAGE).so ! endif ! ! IMPLIB_NAME = $(LIB_DIR)/$(IMPLIB_BASENAME) ! LIB_NAME = $(IMPLIB_NAME) ! ! # -------- Default system paths. ------------ ! ! ifndef SYSTEM_DIR ! SYSTEM_DIR = /usr/local ! endif ! SYSTEM_INCLUDE_DIR = $(SYSTEM_DIR)/include ! SYSTEM_LIB_DIR = $(SYSTEM_DIR)/lib ! ! # -------- Set up mktext -------- ! ALLEGRO_DAT = $(ALLEGRO_DAT_X) ! CGUI_DAT2C = $(CGUI_DAT2C_X) ! CCOM_DAT = $(CCOM_DAT_X) ! CCOM_DAT_C = $(CCOM_DAT_C_X) ! CCOM_DAT_H = $(CCOM_DAT_H_X) ! CCOM_LABELS = $(CCOM_LABELS_X) ! TEXT_SOURCES = $(TEXT_SOURCES_X) ! TEXT_HEADERS = $(TEXT_HEADERS_X) ! MKTEXT = $(MKTEXT_X) ! ! # -------- Give a sensible default target for make without any args. -------- ! # This must be done right after the tests, which can generate error targets. ! ! .PHONY: _default ! ! _default: default ! ! # -------- Decide what compiler options and libraries to use. -------- ! ! ifdef WARNMODE ! WFLAGS = -Wall -W -Werror ! else ! WFLAGS = -Wall -Wno-unused ! endif ! ! ifdef PGCC ! OFLAGS = -mcpu=pentium -O6 -ffast-math ! else ! ifdef PENTIUMONLY ! OFLAGS = -march=pentium -O2 -funroll-loops -ffast-math ! else ! OFLAGS = -mcpu=pentium -O2 -funroll-loops -ffast-math ! endif ! endif ! ! ifdef STATICLINK ! ALLEGRO_CONFIG_FLAGS = --static ! LIB_FLAGS = -lcgui_s ! else ! ALLEGRO_CONFIG_FLAGS = --shared ! LIB_FLAGS = -lcgui ! endif ! ! ifdef DEBUGMODE ! # debugging build ! CFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) -g ! SFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) ! LFLAGS += -g ! LIB_FLAGS += `allegro-config --libs debug $(ALLEGRO_CONFIG_FLAGS)` ! else ! ifdef PROFILEMODE ! # profiling build ! CFLAGS = $(WFLAGS) $(OFLAGS) -pg ! SFLAGS = $(WFLAGS) ! LFLAGS += -pg ! LIB_FLAGS += `allegro-config --libs profile $(ALLEGRO_CONFIG_FLAGS)` ! else ! # optimised build ! CFLAGS = $(WFLAGS) $(OFLAGS) -fomit-frame-pointer -fno-strength-reduce ! SFLAGS = $(WFLAGS) ! ifndef SYMBOLMODE ! LFLAGS += -s ! LIB_FLAGS += `allegro-config --libs release $(ALLEGRO_CONFIG_FLAGS)` ! endif ! endif ! endif ! ! ifdef CCOM_DEVELOPING ! CFLAGS += -D_CCOM_DEVELOPING=1 ! endif ! ifdef CCOM_FORTIFY ! CFLAGS += -D_CCOM_FORTIFY=1 -DFORTIFY ! endif ! ! CFLAGS_NO_OPTIMIZE = $(WFLAGS) ! ! COMPILE_FLAGS = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS) ! COMPILE_FLAGS_NO_OPTIMIZE = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS_NO_OPTIMIZE) ! ! ifdef STATICLINK ! COMPILE_FLAGS += -DCCOM_STATICLINK ! endif ! ! ifdef PROFILEMODE ! LIB_FLAGS += -lgmon ! endif ! ! # -------- List platform specific objects and programs. -------- ! ! VPATH += ! ! OBJ_LIST = $(COMMON_OBJS) ! ! # Insert names of targets to build platform specific programs here. ! PROGRAMS = ! # Insert targets to build platform specific programs here. ! # myprogram: path/myprogram$(EXE_SUFFIX) ! ! # -------- Define how to compile. -------- ! ! GCC2UNIX = -D__UNIX__ -UDJGPP ! ! define COMPILE_C_TO_OBJ ! gcc $(COMPILE_FLAGS) -I./include -o $@ -c $< ! endef ! ! ifdef STATICLINK ! # link as a static library ! define LINK_OBJ_TO_LIB ! ar rs $(LIB_NAME) $(LIB_OBJS) ! endef ! ! define LINK_OBJ_TO_EXE ! gcc $(LFLAGS) -o $@ $< $(IMPLIB_NAME) $(LIB_FLAGS) ! endef ! else ! # link as a shared object ! define LINK_OBJ_TO_LIB ! gcc $(LFLAGS) -shared -o $(IMPLIB_NAME) $(LIB_OBJS) $(LIB_FLAGS) ! endef ! ! define LINK_OBJ_TO_EXE ! gcc $(LFLAGS) -o $@ $< -L$(LIB_DIR) -lccom $(LIB_FLAGS) ! endef ! endif ! ! # -------- Rules for installing and removing the library files. -------- ! ! # If you don't have the install command, you may use cp and mkdir, but ! # this will not set permissions. ! ! $(SYSTEM_LIB_DIR)/$(IMPLIB_BASENAME): $(IMPLIB_NAME) ! install -m 755 -d $(SYSTEM_LIB_DIR) ! install -m 644 $< $@ ! ! $(SYSTEM_INCLUDE_DIR)/ccom.h: include/ccom.h ! install -m 755 -d $(SYSTEM_INCLUDE_DIR) ! install -m 644 $< $@ ! ! $(SYSTEM_INCLUDE_DIR)/ccom/%.h: include/ccom/%.h include/ccom ! install -m 755 -d $(SYSTEM_INCLUDE_DIR)/ccom ! install -m 644 $< $@ ! ! ! INSTALL_HEADERS = $(addprefix $(SYSTEM_DIR)/,$(wildcard include/ccom/*.h)) ! ! INSTALL_FILES = $(SYSTEM_LIB_DIR)/$(IMPLIB_BASENAME) \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(INSTALL_HEADERS) ! ! install: $(INSTALL_FILES) ! @echo The $(DESCRIPTION) UNIX library has been installed. ! ! UNINSTALL_FILES = $(SYSTEM_LIB_DIR)/libccom_s.a $(SYSTEM_LIB_DIR)/libccomd_s.a \ ! $(SYSTEM_LIB_DIR)/libccom.so $(SYSTEM_LIB_DIR)/libccomd.so \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h ! ! uninstall: ! -rm -fv $(UNINSTALL_FILES) ! -rm -frv $(SYSTEM_INCLUDE_DIR)/ccom ! @echo All gone! ! ! # -------- generate automatic dependencies -------- ! ! DEPEND_PARAMS = $(GCC2UNIX) -MM -MG -I./include -DCCOM_SCAN_DEPEND ! ! depend: ! gcc $(DEPEND_PARAMS) src/*.c examples/*.c > _depend.tmp ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/unix\/ccom\/\1\.o:/" _depend.tmp > obj/unix/ccom/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/unix\/ccomd\/\1\.o:/" _depend.tmp > obj/unix/ccomd/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/unix\/ccom_s\/\1\.o:/" _depend.tmp > obj/unix/ccom_s/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/unix\/ccomd_s\/\1\.o:/" _depend.tmp > obj/unix/ccomd_s/makefile.dep ! rm _depend.tmp Index: makefile.ver =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/makefile.ver,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** makefile.ver 21 Jun 2004 19:17:54 -0000 1.6 --- makefile.ver 8 Nov 2004 21:15:21 -0000 1.7 *************** *** 1,10 **** ! # version numbers included by the main makefile ! # this file is patched by fixver.sh ! ! # DLL filename number for Windows ! LIB_VERSION = 09 ! ! # Shared library versions for Unix ! # todo: this is unused at the moment ! shared_version = 0.9.2 ! shared_major_minor = 0.9 --- 1,10 ---- ! # version numbers included by the main makefile ! # this file is patched by fixver.sh ! ! # DLL filename number for Windows ! LIB_VERSION = 09 ! ! # Shared library versions for Unix ! # todo: this is unused at the moment ! shared_version = 0.9.2 ! shared_major_minor = 0.9 Index: makefile.bcc =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/makefile.bcc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** makefile.bcc 21 Jun 2004 19:17:54 -0000 1.5 --- makefile.bcc 8 Nov 2004 21:15:21 -0000 1.6 *************** *** 1,334 **** ! # makefile.bcc: ! # Makefile for the CCOM library with Borland C++Builder. ! # Should not be used directly! ! # ! # By Christer Sandberg (ported from Adime made by Sven Sandberg). ! # See readme.txt for more information about CCOM. ! # See makefile.all for a list of the available targets. ! # ! # You need to set BCC32DIR to the directory where Borland C++Builder is ! # located. ! # ! # This build uses djgpp for calculating source dependencies. ! # The "depend" target uses sed. ! ! ! # -------- define some variables that the primary makefile will use -------- ! ! PLATFORM = BCC32 ! ! EXE_SUFFIX = .exe ! OBJ_SUFFIX = .obj ! LIB_SUFFIX = .lib ! HTML_SUFFIX = .html ! INFO_SUFFIX = .info ! TEXI_SUFFIX = .texi ! ! _TX_HTML_FLAG = -html ! _TX_TEXI_FLAG = -texi ! ! ifndef OBJ_ROOT_DIR ! OBJ_ROOT_DIR = obj ! OBJ_ROOT_DIR_D = obj ! endif ! OBJ_PLATFORM_ROOT_DIR = $(OBJ_ROOT_DIR)/bcc32 ! OBJ_PLATFORM_ROOT_DIR_D = $(OBJ_ROOT_DIR_D)\bcc32 ! ! ifndef LIB_ROOT_DIR ! LIB_ROOT_DIR = lib ! LIB_ROOT_DIR_D = lib ! endif ! LIB_DIR = $(LIB_ROOT_DIR)/bcc32 ! LIB_DIR_D = $(LIB_ROOT_DIR)\bcc32 ! ! ! ifdef STATICLINK ! # link as a static library ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE)_s ! OBJ_DIR_D = $(OBJ_PLATFORM_ROOT_DIR_D)\$(PACKAGE)_s ! IMPLIB_BASENAME = $(PACKAGE)_s$(LIB_SUFFIX) ! else ! # link as a DLL ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE) ! OBJ_DIR_D = $(OBJ_PLATFORM_ROOT_DIR_D)\$(PACKAGE) ! DLL_BASENAME = $(PACKAGE)$(LIB_VERSION).dll ! DLL_NAME = $(LIB_DIR)/$(DLL_BASENAME) ! IMPLIB_BASENAME = $(PACKAGE)$(LIB_SUFFIX) ! EXPDEF_NAME = $(LIB_DIR)/ccom.def ! IMPDEF_NAME = $(LIB_DIR)/impccom.def ! endif ! ! # -------- Check that environment path variables are set. -------- ! ! .PHONY: badwin badbcc32 ! ! ifeq ($(OS),Windows_NT) ! WINSYSDIR = $(SYSTEMROOT) ! WINSUBDIR = system32 ! else ! WINSYSDIR = $(windir) ! WINSUBDIR = system ! endif ! ! ifneq ($(WINSYSDIR),) ! WINDIR_U = $(subst \,/,$(WINSYSDIR)/$(WINSUBDIR)) ! WINDIR_D = $(subst /,\,$(WINSYSDIR)/$(WINSUBDIR)) ! else ! badwin: ! @echo Your SYSTEMROOT or windir environment variable is not set! ! endif ! ! ifdef BCC32DIR ! BCC32DIR_U = $(subst \,/,$(BCC32DIR)) ! BCC32DIR_D = $(subst /,\,$(BCC32DIR)) ! else ! badbcc32: ! @echo You need to set BCC32DIR to the directory where Borland C++Builder is ! @echo located. ! endif ! ! ! SYSTEM_INCLUDE_DIR = $(BCC32DIR_U)/include ! SYSTEM_INCLUDE_DIR_D = $(BCC32DIR_D)\include ! SYSTEM_LIB_DIR = $(BCC32DIR_U)/lib ! SYSTEM_LIB_DIR_D = $(BCC32DIR_D)\lib ! ! # -------- Set up mktext -------- ! ifdef UNIX_TOOLS ! ALLEGRO_DAT = $(subst \,/,$(ALLEGRO_DAT_X)) ! CGUI_DAT2C = $(subst /,\,$(CGUI_DAT2C_X)) ! CCOM_DAT = $(subst /,\,$(CCOM_DAT_X)) ! CCOM_DAT_C = $(subst \,/,$(CCOM_DAT_C_X)) ! CCOM_DAT_H = $(subst \,/,$(CCOM_DAT_H_X)) ! CCOM_LABELS = $(subst \,/,$(CCOM_LABELS_X)) ! TEXT_SOURCES = $(subst \,/,$(TEXT_SOURCES_X)) ! TEXT_HEADERS = $(subst \,/,$(TEXT_HEADERS_X)) ! MKTEXT = $(subst \,/,$(MKTEXT_X)) ! else ! ALLEGRO_DAT = $(subst /,\,$(ALLEGRO_DAT_X)) ! CGUI_DAT2C = $(subst /,\,$(CGUI_DAT2C_X)) ! CCOM_DAT = $(subst /,\,$(CCOM_DAT_X)) ! CCOM_DAT_C = $(subst /,\,$(CCOM_DAT_C_X)) ! CCOM_DAT_H = $(subst /,\,$(CCOM_DAT_H_X)) ! CCOM_LABELS = $(subst /,\,$(CCOM_LABELS_X)) ! TEXT_SOURCES = $(subst /,\,$(TEXT_SOURCES_X)) ! TEXT_HEADERS = $(subst /,\,$(TEXT_HEADERS_X)) ! MKTEXT = $(subst /,\,$(MKTEXT_X)) ! endif ! ! # -------- give a sensible default target for make without any args -------- ! ! .PHONY: _default ! ! _default: default ! ! # -------- decide what compiler options to use -------- ! ! ifdef WARNMODE ! WFLAGS = -w ! else ! WFLAGS = ! endif ! ! ifdef DEBUGMODE ! # -------- debugging build -------- ! CFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) -Od -q -R -v ! SFLAGS = -DDEBUGMODE=$(DEBUGMODE) ! LFLAGS = /q /Gn /v ! ifdef STATICLINK ! LIB_FLAGS = alld_s.lib ! else ! LIB_FLAGS = alld.lib ! endif ! else ! ifdef PROFILEMODE ! # -------- profiling build -------- ! CFLAGS = $(WFLAGS) -O2 -OS -q -R -v ! SFLAGS = $(WFLAGS) ! LFLAGS = /q /Gn /v ! ifdef STATICLINK ! LIB_FLAGS = allp_s.lib ! else ! LIB_FLAGS = allp.lib ! endif ! else ! # -------- optimised build -------- ! CFLAGS = $(WFLAGS) -O2 -OS -q ! SFLAGS = $(WFLAGS) ! LFLAGS = /x /q /Gn ! DELETE_TDS_FILES = 1 ! ifdef STATICLINK ! LIB_FLAGS = alleg_s.lib ! else ! LIB_FLAGS = alleg.lib ! endif ! endif ! endif ! ! ifdef CCOM_DEVELOPING ! CFLAGS += -D_CCOM_DEVELOPING=1 ! endif ! ifdef CCOM_FORTIFY ! CFLAGS += -D_CCOM_FORTIFY=1 -DFORTIFY ! endif ! ! CFLAGS_NO_OPTIMIZE = $(WFLAGS) -Od -q ! ! COMPILE_FLAGS = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS) ! COMPILE_FLAGS_NO_OPTIMIZE = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS_NO_OPTIMIZE) ! ! ifdef STATICLINK ! COMPILE_FLAGS += -DCCOM_STATICLINK ! endif ! ! LIB_FLAGS += cw32.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib \ ! dinput.lib ddraw.lib winmm.lib dsound.lib ! ! # -------- List platform specific objects and programs. -------- ! ! VPATH += ! ! OBJ_LIST = $(COMMON_OBJS) ! ! # Insert names of targets to build platform specific programs here. ! PROGRAMS = ! # Insert targets to build platform specific programs here. ! # myprogram: path/myprogram$(EXE_SUFFIX) ! ! # -------- Define how to compile. -------- ! ! GCC2BCC = -D__BORLANDC__ -UDJGPP ! ! define COMPILE_C_TO_OBJ ! bcc32 $(COMPILE_FLAGS) -W -I. -I./include -c -o$(subst /,\,$@) $(subst /,\,$<) ! endef ! ! define MAKE_LIB_RSP ! $(foreach lib, $(LIB_FLAGS), echo $(subst /,\\,$(lib)) + >> lib.rsp ! ) ! endef ! ! lib.rsp: ! $(MAKE_LIB_RSP) ! ! CLEAN_FILES += lib.rsp ! ! LINK_OBJ_TO_EXE_DEPS = lib.rsp ! define DO_LINK_OBJ_TO_EXE ! ilink32 $(LFLAGS) /aa /Tpe c0w32 $(subst /,\,$<),$(subst /,\,$@),,$(subst /,\,$(IMPLIB_NAME) @lib.rsp) ! endef ! ifdef DELETE_TDS_FILES ! define LINK_OBJ_TO_EXE ! $(DO_LINK_OBJ_TO_EXE) ! @del $(subst .exe,.tds,$(subst /,\,$@)) ! endef ! else ! LINK_OBJ_TO_EXE = $(DO_LINK_OBJ_TO_EXE) ! endif ! ! ifdef STATICLINK ! # link as a static library ! define LINK_OBJ_TO_LIB ! $(foreach objfile, $(LIB_OBJS), tlib /P32 $(subst /,\,$(LIB_NAME) + $(objfile))) ! @del $(subst /,\,$(subst .lib,.BAK,$(LIB_NAME))) ! endef ! else ! # link as a DLL ! LINK_OBJ_TO_LIB_DEPS = lib.rsp ! define DO_LINK_OBJ_TO_LIB ! -del libobj.rsp ! $(foreach libobjfile, $(LIB_OBJS), echo $(subst /,\\,$(libobjfile)) + >> libobj.rsp ! ) ! ilink32 $(LFLAGS) /Tpd c0s32 @libobj.rsp,$(subst /,\,$(DLL_NAME)),,@lib.rsp,$(subst /,\,$(EXPDEF_NAME)) ! del libobj.rsp ! echo LIBRARY $(DLL_BASENAME) > _impccom.def ! copy _impccom.def + $(subst /,\,$(IMPDEF_NAME)) _impdim2.def ! implib $(subst /,\,$(IMPLIB_NAME)) _impdim2.def ! del _impccom.def ! del _impdim2.def ! endef ! ifdef DELETE_TDS_FILES ! define LINK_OBJ_TO_LIB ! $(DO_LINK_OBJ_TO_LIB) ! @del $(subst .dll,.tds,$(subst /,\,$@)) ! endef ! else ! LINK_OBJ_TO_LIB = $(DO_LINK_OBJ_TO_LIB) ! endif ! endif # ifdef STATICLINK ! ! # -------- Rules for installing and removing the library files. -------- ! ! ifneq ($(wildcard $(DJDIR)/bin/cp.exe),) ! HAVE_CP = 1 ! endif ! ! ifndef STATICLINK ! $(WINDIR_U)/$(DLL_BASENAME): $(DLL_NAME) ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! endif ! ! $(SYSTEM_LIB_DIR)/$(IMPLIB_BASENAME): $(IMPLIB_NAME) ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! ! $(SYSTEM_INCLUDE_DIR)/ccom.h: include/ccom.h ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! ! $(SYSTEM_INCLUDE_DIR)/ccom: ! md $(subst /,\,$@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom/%.h: include/ccom/%.h include/ccom ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! ! INSTALL_HEADERS = $(addprefix $(BCC32DIR_U)/,$(wildcard include/ccom/*.h)) ! ! INSTALL_FILES = $(SYSTEM_LIB_DIR)/$(IMPLIB_BASENAME) \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(SYSTEM_INCLUDE_DIR)/ccom \ ! $(INSTALL_HEADERS) ! ! ifndef STATICLINK ! INSTALL_FILES += $(WINDIR_U)/$(DLL_BASENAME) ! endif ! ! install: $(INSTALL_FILES) ! @echo The $(DESCRIPTION) BCC32 library has been installed. ! ! UNINSTALL_FILES = \ ! $(SYSTEM_LIB_DIR)/ccom.lib $(SYSTEM_LIB_DIR)/ccom_s.lib \ ! $(SYSTEM_LIB_DIR)/ccomd.lib $(SYSTEM_LIB_DIR)/ccomd_s.lib \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(WINDIR_U)/ccom$(LIB_VERSION).dll $(WINDIR_U)/ccomd$(LIB_VERSION).dll ! ! uninstall: ! -rm -fv $(UNINSTALL_FILES) ! -rm -frv $(SYSTEM_INCLUDE_DIR)/ccom ! @echo All gone! ! ! # -------- Generate automatic dependencies. -------- ! ! DEPEND_PARAMS = $(GCC2BCC) -MM -MG -I. -I./include -DCCOM_SCAN_DEPEND ! ! depend: ! gcc $(DEPEND_PARAMS) src/*.c examples/*.c > _depend.tmp ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/bcc32\/ccom\/\1\.obj:/" _depend.tmp > obj/bcc32/ccom/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/bcc32\/ccomd\/\1\.obj:/" _depend.tmp > obj/bcc32/ccomd/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/bcc32\/ccom_s\/\1\.obj:/" _depend.tmp > obj/bcc32/ccom_s/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/bcc32\/ccomd_s\/\1\.obj:/" _depend.tmp > obj/bcc32/ccomd_s/makefile.dep ! rm _depend.tmp --- 1,334 ---- ! # makefile.bcc: ! # Makefile for the CCOM library with Borland C++Builder. ! # Should not be used directly! ! # ! # By Christer Sandberg (ported from Adime made by Sven Sandberg). ! # See readme.txt for more information about CCOM. ! # See makefile.all for a list of the available targets. ! # ! # You need to set BCC32DIR to the directory where Borland C++Builder is ! # located. ! # ! # This build uses djgpp for calculating source dependencies. ! # The "depend" target uses sed. ! ! ! # -------- define some variables that the primary makefile will use -------- ! ! PLATFORM = BCC32 ! ! EXE_SUFFIX = .exe ! OBJ_SUFFIX = .obj ! LIB_SUFFIX = .lib ! HTML_SUFFIX = .html ! INFO_SUFFIX = .info ! TEXI_SUFFIX = .texi ! ! _TX_HTML_FLAG = -html ! _TX_TEXI_FLAG = -texi ! ! ifndef OBJ_ROOT_DIR ! OBJ_ROOT_DIR = obj ! OBJ_ROOT_DIR_D = obj ! endif ! OBJ_PLATFORM_ROOT_DIR = $(OBJ_ROOT_DIR)/bcc32 ! OBJ_PLATFORM_ROOT_DIR_D = $(OBJ_ROOT_DIR_D)\bcc32 ! ! ifndef LIB_ROOT_DIR ! LIB_ROOT_DIR = lib ! LIB_ROOT_DIR_D = lib ! endif ! LIB_DIR = $(LIB_ROOT_DIR)/bcc32 ! LIB_DIR_D = $(LIB_ROOT_DIR)\bcc32 ! ! ! ifdef STATICLINK ! # link as a static library ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE)_s ! OBJ_DIR_D = $(OBJ_PLATFORM_ROOT_DIR_D)\$(PACKAGE)_s ! IMPLIB_BASENAME = $(PACKAGE)_s$(LIB_SUFFIX) ! else ! # link as a DLL ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE) ! OBJ_DIR_D = $(OBJ_PLATFORM_ROOT_DIR_D)\$(PACKAGE) ! DLL_BASENAME = $(PACKAGE)$(LIB_VERSION).dll ! DLL_NAME = $(LIB_DIR)/$(DLL_BASENAME) ! IMPLIB_BASENAME = $(PACKAGE)$(LIB_SUFFIX) ! EXPDEF_NAME = $(LIB_DIR)/ccom.def ! IMPDEF_NAME = $(LIB_DIR)/impccom.def ! endif ! ! # -------- Check that environment path variables are set. -------- ! ! .PHONY: badwin badbcc32 ! ! ifeq ($(OS),Windows_NT) ! WINSYSDIR = $(SYSTEMROOT) ! WINSUBDIR = system32 ! else ! WINSYSDIR = $(windir) ! WINSUBDIR = system ! endif ! ! ifneq ($(WINSYSDIR),) ! WINDIR_U = $(subst \,/,$(WINSYSDIR)/$(WINSUBDIR)) ! WINDIR_D = $(subst /,\,$(WINSYSDIR)/$(WINSUBDIR)) ! else ! badwin: ! @echo Your SYSTEMROOT or windir environment variable is not set! ! endif ! ! ifdef BCC32DIR ! BCC32DIR_U = $(subst \,/,$(BCC32DIR)) ! BCC32DIR_D = $(subst /,\,$(BCC32DIR)) ! else ! badbcc32: ! @echo You need to set BCC32DIR to the directory where Borland C++Builder is ! @echo located. ! endif ! ! ! SYSTEM_INCLUDE_DIR = $(BCC32DIR_U)/include ! SYSTEM_INCLUDE_DIR_D = $(BCC32DIR_D)\include ! SYSTEM_LIB_DIR = $(BCC32DIR_U)/lib ! SYSTEM_LIB_DIR_D = $(BCC32DIR_D)\lib ! ! # -------- Set up mktext -------- ! ifdef UNIX_TOOLS ! ALLEGRO_DAT = $(subst \,/,$(ALLEGRO_DAT_X)) ! CGUI_DAT2C = $(subst /,\,$(CGUI_DAT2C_X)) ! CCOM_DAT = $(subst /,\,$(CCOM_DAT_X)) ! CCOM_DAT_C = $(subst \,/,$(CCOM_DAT_C_X)) ! CCOM_DAT_H = $(subst \,/,$(CCOM_DAT_H_X)) ! CCOM_LABELS = $(subst \,/,$(CCOM_LABELS_X)) ! TEXT_SOURCES = $(subst \,/,$(TEXT_SOURCES_X)) ! TEXT_HEADERS = $(subst \,/,$(TEXT_HEADERS_X)) ! MKTEXT = $(subst \,/,$(MKTEXT_X)) ! else ! ALLEGRO_DAT = $(subst /,\,$(ALLEGRO_DAT_X)) ! CGUI_DAT2C = $(subst /,\,$(CGUI_DAT2C_X)) ! CCOM_DAT = $(subst /,\,$(CCOM_DAT_X)) ! CCOM_DAT_C = $(subst /,\,$(CCOM_DAT_C_X)) ! CCOM_DAT_H = $(subst /,\,$(CCOM_DAT_H_X)) ! CCOM_LABELS = $(subst /,\,$(CCOM_LABELS_X)) ! TEXT_SOURCES = $(subst /,\,$(TEXT_SOURCES_X)) ! TEXT_HEADERS = $(subst /,\,$(TEXT_HEADERS_X)) ! MKTEXT = $(subst /,\,$(MKTEXT_X)) ! endif ! ! # -------- give a sensible default target for make without any args -------- ! ! .PHONY: _default ! ! _default: default ! ! # -------- decide what compiler options to use -------- ! ! ifdef WARNMODE ! WFLAGS = -w ! else ! WFLAGS = ! endif ! ! ifdef DEBUGMODE ! # -------- debugging build -------- ! CFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) -Od -q -R -v ! SFLAGS = -DDEBUGMODE=$(DEBUGMODE) ! LFLAGS = /q /Gn /v ! ifdef STATICLINK ! LIB_FLAGS = alld_s.lib ! else ! LIB_FLAGS = alld.lib ! endif ! else ! ifdef PROFILEMODE ! # -------- profiling build -------- ! CFLAGS = $(WFLAGS) -O2 -OS -q -R -v ! SFLAGS = $(WFLAGS) ! LFLAGS = /q /Gn /v ! ifdef STATICLINK ! LIB_FLAGS = allp_s.lib ! else ! LIB_FLAGS = allp.lib ! endif ! else ! # -------- optimised build -------- ! CFLAGS = $(WFLAGS) -O2 -OS -q ! SFLAGS = $(WFLAGS) ! LFLAGS = /x /q /Gn ! DELETE_TDS_FILES = 1 ! ifdef STATICLINK ! LIB_FLAGS = alleg_s.lib ! else ! LIB_FLAGS = alleg.lib ! endif ! endif ! endif ! ! ifdef CCOM_DEVELOPING ! CFLAGS += -D_CCOM_DEVELOPING=1 ! endif ! ifdef CCOM_FORTIFY ! CFLAGS += -D_CCOM_FORTIFY=1 -DFORTIFY ! endif ! ! CFLAGS_NO_OPTIMIZE = $(WFLAGS) -Od -q ! ! COMPILE_FLAGS = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS) ! COMPILE_FLAGS_NO_OPTIMIZE = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS_NO_OPTIMIZE) ! ! ifdef STATICLINK ! COMPILE_FLAGS += -DCCOM_STATICLINK ! endif ! ! LIB_FLAGS += cw32.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib \ ! dinput.lib ddraw.lib winmm.lib dsound.lib ! ! # -------- List platform specific objects and programs. -------- ! ! VPATH += ! ! OBJ_LIST = $(COMMON_OBJS) ! ! # Insert names of targets to build platform specific programs here. ! PROGRAMS = ! # Insert targets to build platform specific programs here. ! # myprogram: path/myprogram$(EXE_SUFFIX) ! ! # -------- Define how to compile. -------- ! ! GCC2BCC = -D__BORLANDC__ -UDJGPP ! ! define COMPILE_C_TO_OBJ ! bcc32 $(COMPILE_FLAGS) -W -I. -I./include -c -o$(subst /,\,$@) $(subst /,\,$<) ! endef ! ! define MAKE_LIB_RSP ! $(foreach lib, $(LIB_FLAGS), echo $(subst /,\\,$(lib)) + >> lib.rsp ! ) ! endef ! ! lib.rsp: ! $(MAKE_LIB_RSP) ! ! CLEAN_FILES += lib.rsp ! ! LINK_OBJ_TO_EXE_DEPS = lib.rsp ! define DO_LINK_OBJ_TO_EXE ! ilink32 $(LFLAGS) /aa /Tpe c0w32 $(subst /,\,$<),$(subst /,\,$@),,$(subst /,\,$(IMPLIB_NAME) @lib.rsp) ! endef ! ifdef DELETE_TDS_FILES ! define LINK_OBJ_TO_EXE ! $(DO_LINK_OBJ_TO_EXE) ! @del $(subst .exe,.tds,$(subst /,\,$@)) ! endef ! else ! LINK_OBJ_TO_EXE = $(DO_LINK_OBJ_TO_EXE) ! endif ! ! ifdef STATICLINK ! # link as a static library ! define LINK_OBJ_TO_LIB ! $(foreach objfile, $(LIB_OBJS), tlib /P32 $(subst /,\,$(LIB_NAME) + $(objfile))) ! @del $(subst /,\,$(subst .lib,.BAK,$(LIB_NAME))) ! endef ! else ! # link as a DLL ! LINK_OBJ_TO_LIB_DEPS = lib.rsp ! define DO_LINK_OBJ_TO_LIB ! -del libobj.rsp ! $(foreach libobjfile, $(LIB_OBJS), echo $(subst /,\\,$(libobjfile)) + >> libobj.rsp ! ) ! ilink32 $(LFLAGS) /Tpd c0s32 @libobj.rsp,$(subst /,\,$(DLL_NAME)),,@lib.rsp,$(subst /,\,$(EXPDEF_NAME)) ! del libobj.rsp ! echo LIBRARY $(DLL_BASENAME) > _impccom.def ! copy _impccom.def + $(subst /,\,$(IMPDEF_NAME)) _impdim2.def ! implib $(subst /,\,$(IMPLIB_NAME)) _impdim2.def ! del _impccom.def ! del _impdim2.def ! endef ! ifdef DELETE_TDS_FILES ! define LINK_OBJ_TO_LIB ! $(DO_LINK_OBJ_TO_LIB) ! @del $(subst .dll,.tds,$(subst /,\,$@)) ! endef ! else ! LINK_OBJ_TO_LIB = $(DO_LINK_OBJ_TO_LIB) ! endif ! endif # ifdef STATICLINK ! ! # -------- Rules for installing and removing the library files. -------- ! ! ifneq ($(wildcard $(DJDIR)/bin/cp.exe),) ! HAVE_CP = 1 ! endif ! ! ifndef STATICLINK ! $(WINDIR_U)/$(DLL_BASENAME): $(DLL_NAME) ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! endif ! ! $(SYSTEM_LIB_DIR)/$(IMPLIB_BASENAME): $(IMPLIB_NAME) ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! ! $(SYSTEM_INCLUDE_DIR)/ccom.h: include/ccom.h ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! ! $(SYSTEM_INCLUDE_DIR)/ccom: ! md $(subst /,\,$@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom/%.h: include/ccom/%.h include/ccom ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! ! INSTALL_HEADERS = $(addprefix $(BCC32DIR_U)/,$(wildcard include/ccom/*.h)) ! ! INSTALL_FILES = $(SYSTEM_LIB_DIR)/$(IMPLIB_BASENAME) \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(SYSTEM_INCLUDE_DIR)/ccom \ ! $(INSTALL_HEADERS) ! ! ifndef STATICLINK ! INSTALL_FILES += $(WINDIR_U)/$(DLL_BASENAME) ! endif ! ! install: $(INSTALL_FILES) ! @echo The $(DESCRIPTION) BCC32 library has been installed. ! ! UNINSTALL_FILES = \ ! $(SYSTEM_LIB_DIR)/ccom.lib $(SYSTEM_LIB_DIR)/ccom_s.lib \ ! $(SYSTEM_LIB_DIR)/ccomd.lib $(SYSTEM_LIB_DIR)/ccomd_s.lib \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(WINDIR_U)/ccom$(LIB_VERSION).dll $(WINDIR_U)/ccomd$(LIB_VERSION).dll ! ! uninstall: ! -rm -fv $(UNINSTALL_FILES) ! -rm -frv $(SYSTEM_INCLUDE_DIR)/ccom ! @echo All gone! ! ! # -------- Generate automatic dependencies. -------- ! ! DEPEND_PARAMS = $(GCC2BCC) -MM -MG -I. -I./include -DCCOM_SCAN_DEPEND ! ! depend: ! gcc $(DEPEND_PARAMS) src/*.c examples/*.c > _depend.tmp ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/bcc32\/ccom\/\1\.obj:/" _depend.tmp > obj/bcc32/ccom/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/bcc32\/ccomd\/\1\.obj:/" _depend.tmp > obj/bcc32/ccomd/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/bcc32\/ccom_s\/\1\.obj:/" _depend.tmp > obj/bcc32/ccom_s/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/bcc32\/ccomd_s\/\1\.obj:/" _depend.tmp > obj/bcc32/ccomd_s/makefile.dep ! rm _depend.tmp Index: makefile.dj =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/makefile.dj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** makefile.dj 21 Jun 2004 19:17:54 -0000 1.5 --- makefile.dj 8 Nov 2004 21:15:21 -0000 1.6 *************** *** 1,279 **** ! # makefile.dj: ! # Makefile for the CCOM library with DJGPP. Should not be used directly! ! # ! # By Christer Sandberg (ported from Adime made by Sven Sandberg). ! # See readme.txt for more information about CCOM. ! # See makefile.all for a list of the available targets. ! ! # -------- Define some variables that the primary makefile may use. -------- ! ! PLATFORM = djgpp ! ! EXE_SUFFIX = .exe ! OBJ_SUFFIX = .o ! LIB_SUFFIX = .a ! ! HTML_SUFFIX = .html ! INFO_SUFFIX = .info ! TEXI_SUFFIX = .texi ! _TX_HTML_FLAG = -html ! _TX_TEXI_FLAG = -texi ! ifndef CROSSCOMPILE ! ifneq ($(LFN),y) ! HTML_SUFFIX = .htm ! INFO_SUFFIX = .inf ! TEXI_SUFFIX = .txi ! _TX_HTML_FLAG = -htm ! _TX_TEXI_FLAG = -txi ! endif ! endif ! ! HAVE_TEXINFO = 1 ! ! ifndef OBJ_ROOT_DIR ! OBJ_ROOT_DIR = obj ! OBJ_ROOT_DIR_D = obj ! endif ! OBJ_PLATFORM_ROOT_DIR = $(OBJ_ROOT_DIR)/djgpp ! OBJ_PLATFORM_ROOT_DIR_D = $(OBJ_ROOT_DIR_D)\djgpp ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE) ! OBJ_DIR_D = $(OBJ_PLATFORM_ROOT_DIR_D)\$(PACKAGE) ! ! ifndef LIB_ROOT_DIR ! LIB_ROOT_DIR = lib ! LIB_ROOT_DIR_D = lib ! endif ! LIB_DIR = $(LIB_ROOT_DIR)/djgpp ! LIB_DIR_D = $(LIB_ROOT_DIR)\djgpp ! ! LIB_BASENAME = lib$(PACKAGE).a ! LIB_NAME = $(LIB_DIR)/$(LIB_BASENAME) ! ! # -------- Find djgpp. -------- ! ! .PHONY: baddjgpp ! ! ifndef DJDIR ! baddjgpp: ! @echo DJDIR variable not set! ! @echo You must set the environment variable DJDIR to point to your djgpp ! @echo directory, e.g. "set DJDIR=c:\djgpp" ! endif ! DJGPPDIR_U = $(subst \,/,$(DJDIR)) ! DJGPPDIR_D = $(subst /,\,$(DJDIR)) ! ! SYSTEM_INCLUDE_DIR = $(DJGPPDIR_U)/include ! SYSTEM_INCLUDE_DIR_D = $(DJGPPDIR_D)\include ! SYSTEM_LIB_DIR = $(DJGPPDIR_U)/lib ! SYSTEM_LIB_DIR_D = $(DJGPPDIR_D)/lib ! SYSTEM_INFO_DIR = $(DJGPPDIR_U)/info ! SYSTEM_INFO_DIR = $(DJGPPDIR_D)\info ! ! ifneq (,$(findstring /sh.exe,$(SHELL))) ! UNIX_TOOLS = 1 ! endif ! ! ifdef UNIX_TOOLS ! CP = cp ! RM = rm ! MKDIR = mkdir ! else ! CP = copy ! RM = del ! MKDIR = md ! endif ! ! # -------- Set up mktext -------- ! ifdef UNIX_TOOLS ! ALLEGRO_DAT = $(subst \,/,$(ALLEGRO_DAT_X)) ! CGUI_DAT2C = $(subst /,\,$(CGUI_DAT2C_X)) ! CCOM_DAT = $(subst /,\,$(CCOM_DAT_X)) ! CCOM_DAT_C = $(subst \,/,$(CCOM_DAT_C_X)) ! CCOM_DAT_H = $(subst \,/,$(CCOM_DAT_H_X)) ! CCOM_LABELS = $(subst \,/,$(CCOM_LABELS_X)) ! TEXT_SOURCES = $(subst \,/,$(TEXT_SOURCES_X)) ! TEXT_HEADERS = $(subst \,/,$(TEXT_HEADERS_X)) ! MKTEXT = $(subst \,/,$(MKTEXT_X)) ! else ! ALLEGRO_DAT = $(subst /,\,$(ALLEGRO_DAT_X)) ! CGUI_DAT2C = $(subst /,\,$(CGUI_DAT2C_X)) ! CCOM_DAT = $(subst /,\,$(CCOM_DAT_X)) ! CCOM_DAT_C = $(subst /,\,$(CCOM_DAT_C_X)) ! CCOM_DAT_H = $(subst /,\,$(CCOM_DAT_H_X)) ! CCOM_LABELS = $(subst /,\,$(CCOM_LABELS_X)) ! TEXT_SOURCES = $(subst /,\,$(TEXT_SOURCES_X)) ! TEXT_HEADERS = $(subst /,\,$(TEXT_HEADERS_X)) ! MKTEXT = $(subst /,\,$(MKTEXT_X)) ! endif ! ! ! # -------- Give a sensible default target for make without any args. -------- ! # This must be done right after the tests, which can generate error targets. ! ! .PHONY: _default ! ! _default: default ! ! # -------- Decide what compiler options and libraries to use. -------- ! ! ifdef WARNMODE ! WFLAGS = -Wall -W -Werror ! else ! WFLAGS = -Wall -Wno-unused ! endif ! ! ifdef PGCC ! OFLAGS = -mcpu=pentium -O6 -ffast-math ! else ! ifdef PENTIUMONLY ! OFLAGS = -march=pentium -O2 -funroll-loops -ffast-math ! else ! OFLAGS = -mcpu=pentium -O2 -funroll-loops -ffast-math ! endif ! endif ! ! ifdef DEBUGMODE ! # debugging build ! CFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) -g ! SFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) ! LFLAGS = -g3 ! LIB_FLAGS = -lcgui -lalld ! else ! ifdef PROFILEMODE ! # profiling build ! CFLAGS = $(WFLAGS) $(OFLAGS) -pg ! SFLAGS = $(WFLAGS) ! LFLAGS = -pg ! LIB_FLAGS = -lcgui -lallp ! else ! # optimised build ! CFLAGS = $(WFLAGS) $(OFLAGS) -fomit-frame-pointer -fno-strength-reduce ! SFLAGS = $(WFLAGS) ! ifndef SYMBOLMODE ! LFLAGS = -s ! LIB_FLAGS = -lcgui -lalleg ! endif ! endif ! endif ! ! ifdef CCOM_DEVELOPING ! CFLAGS += -D_CCOM_DEVELOPING=1 ! endif ! ifdef CCOM_FORTIFY ! CFLAGS += -D_CCOM_FORTIFY=1 -DFORTIFY ! endif ! ! # This is just so that we can test that CCOM doesn't relies on Allegro ! # including some standard header. ! ifdef CCOM_NO_ALLEGRO_STD_HEADERS ! CFLAGS += -DALLEGRO_NO_STD_HEADERS -DEDOM=1 -DERANGE=1 ! endif ! ! CFLAGS_NO_OPTIMIZE = $(WFLAGS) ! ! COMPILE_FLAGS = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS) ! COMPILE_FLAGS_NO_OPTIMIZE = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS_NO_OPTIMIZE) ! ! # -------- List platform specific objects and programs. -------- ! ! VPATH += ! ! OBJ_LIST = $(COMMON_OBJS) ! ! # Insert names of targets to build platform specific programs here. ! PROGRAMS = ! # Insert targets to build platform specific programs here. ! # myprogram: path/myprogram$(EXE_SUFFIX) ! ! # -------- Define how to compile. -------- ! ! GCC2DJGPP = -DDJGPP=2 -U__unix__ ! ! define COMPILE_C_TO_OBJ ! gcc $(COMPILE_FLAGS) -I./include -o $@ -c $< ! endef ! ! define LINK_OBJ_TO_LIB ! ar rs $(LIB_NAME) $(LIB_OBJS) ! endef ! ! define LINK_OBJ_TO_EXE ! gcc $(LFLAGS) -o $@ $< $(LIB_NAME) $(LIB_FLAGS) ! endef ! ! # -------- Rules for installing and removing the library files. -------- ! ! ifdef CROSSCOMPILE ! ! $(SYSTEM_LIB_DIR)/$(LIB_BASENAME): $(LIB_NAME) ! cp $(subst \,/,$< $@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom.h: include/ccom.h ! cp $(subst \,/,$< $@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom: ! mkdir $(subst \,/,$< $@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom/%.h: include/ccom/%.h include/ccom ! cp $(subst \,/,$< $@) ! ! $(SYSTEM_INFO_DIR)/%$(INFO_SUFFIX): docs/%$(INFO_SUFFIX) ! cp $(subst \,/,$< $@) ! install-info $(subst \,/,$@) $(SYSTEM_INFO_DIR)/dir ! ! else # ifdef CROSSCOMPILE ! ! $(SYSTEM_INCLUDE_DIR)/ccom.h: include/ccom.h ! $(CP) $(subst /,\,$< $@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom: ! $(MKDIR) $(subst /,\,$@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom/%.h: include/ccom/%.h include/ccom ! $(CP) $(subst /,\,$< $@) ! ! $(SYSTEM_INFO_DIR)/%$(INFO_SUFFIX): docs/%$(INFO_SUFFIX) ! $(CP) $(subst /,\,$< $@) ! ! $(SYSTEM_LIB_DIR)/$(LIB_BASENAME): $(LIB_NAME) ! $(CP) $(subst /,\,$< $@) ! ! endif # ifdef CROSSCOMPILE else ! ! ! INSTALL_HEADERS = $(addprefix $(DJGPPDIR_U)/,$(wildcard include/ccom/*.h)) ! ! INSTALL_FILES = $(SYSTEM_LIB_DIR)/$(LIB_BASENAME) \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(SYSTEM_INCLUDE_DIR)/ccom \ ! $(INSTALL_HEADERS) \ ! $(SYSTEM_INFO_DIR)/ccom$(INFO_SUFFIX) ! ! install: $(INSTALL_FILES) ! @echo The $(DESCRIPTION) djgpp library has been installed. ! ! UNINSTALL_FILES = $(SYSTEM_LIB_DIR)/libccom.a $(SYSTEM_LIB_DIR)/libccomd.a \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(SYSTEM_INFO_DIR)/ccom$(INFO_SUFFIX) ! ! uninstall: ! -rm -fv $(UNINSTALL_FILES) ! -rm -frv $(SYSTEM_INCLUDE_DIR)/ccom ! @echo All gone! ! ! ! ! # -------- Compile anything that can't be done in makefile.all. -------- ! ! # this section is empty ! ! ! # -------- Generate automatic dependencies. -------- ! ! DEPEND_PARAMS = $(GCC2DJGPP) -MM -MG -I. -I./include -DCCOM_SCAN_DEPEND ! ! depend: ! gcc $(DEPEND_PARAMS) src/*.c examples/*.c $(wildcard docs/*.c src/misc/*.c) > _depend.tmp ! sed -e "s/^\([a-zA-Z0-9_]*\.o:\)/obj\/djgpp\/ccom\/\1/" _depend.tmp > obj/djgpp/ccom/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\.o:\)/obj\/djgpp\/ccomd\/\1/" _depend.tmp > obj/djgpp/ccomd/makefile.dep ! rm _depend.tmp --- 1,279 ---- ! # makefile.dj: ! # Makefile for the CCOM library with DJGPP. Should not be used directly! ! # ! # By Christer Sandberg (ported from Adime made by Sven Sandberg). ! # See readme.txt for more information about CCOM. ! # See makefile.all for a list of the available targets. ! ! # -------- Define some variables that the primary makefile may use. -------- ! ! PLATFORM = djgpp ! ! EXE_SUFFIX = .exe ! OBJ_SUFFIX = .o ! LIB_SUFFIX = .a ! ! HTML_SUFFIX = .html ! INFO_SUFFIX = .info ! TEXI_SUFFIX = .texi ! _TX_HTML_FLAG = -html ! _TX_TEXI_FLAG = -texi ! ifndef CROSSCOMPILE ! ifneq ($(LFN),y) ! HTML_SUFFIX = .htm ! INFO_SUFFIX = .inf ! TEXI_SUFFIX = .txi ! _TX_HTML_FLAG = -htm ! _TX_TEXI_FLAG = -txi ! endif ! endif ! ! HAVE_TEXINFO = 1 ! ! ifndef OBJ_ROOT_DIR ! OBJ_ROOT_DIR = obj ! OBJ_ROOT_DIR_D = obj ! endif ! OBJ_PLATFORM_ROOT_DIR = $(OBJ_ROOT_DIR)/djgpp ! OBJ_PLATFORM_ROOT_DIR_D = $(OBJ_ROOT_DIR_D)\djgpp ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE) ! OBJ_DIR_D = $(OBJ_PLATFORM_ROOT_DIR_D)\$(PACKAGE) ! ! ifndef LIB_ROOT_DIR ! LIB_ROOT_DIR = lib ! LIB_ROOT_DIR_D = lib ! endif ! LIB_DIR = $(LIB_ROOT_DIR)/djgpp ! LIB_DIR_D = $(LIB_ROOT_DIR)\djgpp ! ! LIB_BASENAME = lib$(PACKAGE).a ! LIB_NAME = $(LIB_DIR)/$(LIB_BASENAME) ! ! # -------- Find djgpp. -------- ! ! .PHONY: baddjgpp ! ! ifndef DJDIR ! baddjgpp: ! @echo DJDIR variable not set! ! @echo You must set the environment variable DJDIR to point to your djgpp ! @echo directory, e.g. "set DJDIR=c:\djgpp" ! endif ! DJGPPDIR_U = $(subst \,/,$(DJDIR)) ! DJGPPDIR_D = $(subst /,\,$(DJDIR)) ! ! SYSTEM_INCLUDE_DIR = $(DJGPPDIR_U)/include ! SYSTEM_INCLUDE_DIR_D = $(DJGPPDIR_D)\include ! SYSTEM_LIB_DIR = $(DJGPPDIR_U)/lib ! SYSTEM_LIB_DIR_D = $(DJGPPDIR_D)/lib ! SYSTEM_INFO_DIR = $(DJGPPDIR_U)/info ! SYSTEM_INFO_DIR = $(DJGPPDIR_D)\info ! ! ifneq (,$(findstring /sh.exe,$(SHELL))) ! UNIX_TOOLS = 1 ! endif ! ! ifdef UNIX_TOOLS ! CP = cp ! RM = rm ! MKDIR = mkdir ! else ! CP = copy ! RM = del ! MKDIR = md ! endif ! ! # -------- Set up mktext -------- ! ifdef UNIX_TOOLS ! ALLEGRO_DAT = $(subst \,/,$(ALLEGRO_DAT_X)) ! CGUI_DAT2C = $(subst /,\,$(CGUI_DAT2C_X)) ! CCOM_DAT = $(subst /,\,$(CCOM_DAT_X)) ! CCOM_DAT_C = $(subst \,/,$(CCOM_DAT_C_X)) ! CCOM_DAT_H = $(subst \,/,$(CCOM_DAT_H_X)) ! CCOM_LABELS = $(subst \,/,$(CCOM_LABELS_X)) ! TEXT_SOURCES = $(subst \,/,$(TEXT_SOURCES_X)) ! TEXT_HEADERS = $(subst \,/,$(TEXT_HEADERS_X)) ! MKTEXT = $(subst \,/,$(MKTEXT_X)) ! else ! ALLEGRO_DAT = $(subst /,\,$(ALLEGRO_DAT_X)) ! CGUI_DAT2C = $(subst /,\,$(CGUI_DAT2C_X)) ! CCOM_DAT = $(subst /,\,$(CCOM_DAT_X)) ! CCOM_DAT_C = $(subst /,\,$(CCOM_DAT_C_X)) ! CCOM_DAT_H = $(subst /,\,$(CCOM_DAT_H_X)) ! CCOM_LABELS = $(subst /,\,$(CCOM_LABELS_X)) ! TEXT_SOURCES = $(subst /,\,$(TEXT_SOURCES_X)) ! TEXT_HEADERS = $(subst /,\,$(TEXT_HEADERS_X)) ! MKTEXT = $(subst /,\,$(MKTEXT_X)) ! endif ! ! ! # -------- Give a sensible default target for make without any args. -------- ! # This must be done right after the tests, which can generate error targets. ! ! .PHONY: _default ! ! _default: default ! ! # -------- Decide what compiler options and libraries to use. -------- ! ! ifdef WARNMODE ! WFLAGS = -Wall -W -Werror ! else ! WFLAGS = -Wall -Wno-unused ! endif ! ! ifdef PGCC ! OFLAGS = -mcpu=pentium -O6 -ffast-math ! else ! ifdef PENTIUMONLY ! OFLAGS = -march=pentium -O2 -funroll-loops -ffast-math ! else ! OFLAGS = -mcpu=pentium -O2 -funroll-loops -ffast-math ! endif ! endif ! ! ifdef DEBUGMODE ! # debugging build ! CFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) -g ! SFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) ! LFLAGS = -g3 ! LIB_FLAGS = -lcgui -lalld ! else ! ifdef PROFILEMODE ! # profiling build ! CFLAGS = $(WFLAGS) $(OFLAGS) -pg ! SFLAGS = $(WFLAGS) ! LFLAGS = -pg ! LIB_FLAGS = -lcgui -lallp ! else ! # optimised build ! CFLAGS = $(WFLAGS) $(OFLAGS) -fomit-frame-pointer -fno-strength-reduce ! SFLAGS = $(WFLAGS) ! ifndef SYMBOLMODE ! LFLAGS = -s ! LIB_FLAGS = -lcgui -lalleg ! endif ! endif ! endif ! ! ifdef CCOM_DEVELOPING ! CFLAGS += -D_CCOM_DEVELOPING=1 ! endif ! ifdef CCOM_FORTIFY ! CFLAGS += -D_CCOM_FORTIFY=1 -DFORTIFY ! endif ! ! # This is just so that we can test that CCOM doesn't relies on Allegro ! # including some standard header. ! ifdef CCOM_NO_ALLEGRO_STD_HEADERS ! CFLAGS += -DALLEGRO_NO_STD_HEADERS -DEDOM=1 -DERANGE=1 ! endif ! ! CFLAGS_NO_OPTIMIZE = $(WFLAGS) ! ! COMPILE_FLAGS = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS) ! COMPILE_FLAGS_NO_OPTIMIZE = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS_NO_OPTIMIZE) ! ! # -------- List platform specific objects and programs. -------- ! ! VPATH += ! ! OBJ_LIST = $(COMMON_OBJS) ! ! # Insert names of targets to build platform specific programs here. ! PROGRAMS = ! # Insert targets to build platform specific programs here. ! # myprogram: path/myprogram$(EXE_SUFFIX) ! ! # -------- Define how to compile. -------- ! ! GCC2DJGPP = -DDJGPP=2 -U__unix__ ! ! define COMPILE_C_TO_OBJ ! gcc $(COMPILE_FLAGS) -I./include -o $@ -c $< ! endef ! ! define LINK_OBJ_TO_LIB ! ar rs $(LIB_NAME) $(LIB_OBJS) ! endef ! ! define LINK_OBJ_TO_EXE ! gcc $(LFLAGS) -o $@ $< $(LIB_NAME) $(LIB_FLAGS) ! endef ! ! # -------- Rules for installing and removing the library files. -------- ! ! ifdef CROSSCOMPILE ! ! $(SYSTEM_LIB_DIR)/$(LIB_BASENAME): $(LIB_NAME) ! cp $(subst \,/,$< $@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom.h: include/ccom.h ! cp $(subst \,/,$< $@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom: ! mkdir $(subst \,/,$< $@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom/%.h: include/ccom/%.h include/ccom ! cp $(subst \,/,$< $@) ! ! $(SYSTEM_INFO_DIR)/%$(INFO_SUFFIX): docs/%$(INFO_SUFFIX) ! cp $(subst \,/,$< $@) ! install-info $(subst \,/,$@) $(SYSTEM_INFO_DIR)/dir ! ! else # ifdef CROSSCOMPILE ! ! $(SYSTEM_INCLUDE_DIR)/ccom.h: include/ccom.h ! $(CP) $(subst /,\,$< $@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom: ! $(MKDIR) $(subst /,\,$@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom/%.h: include/ccom/%.h include/ccom ! $(CP) $(subst /,\,$< $@) ! ! $(SYSTEM_INFO_DIR)/%$(INFO_SUFFIX): docs/%$(INFO_SUFFIX) ! $(CP) $(subst /,\,$< $@) ! ! $(SYSTEM_LIB_DIR)/$(LIB_BASENAME): $(LIB_NAME) ! $(CP) $(subst /,\,$< $@) ! ! endif # ifdef CROSSCOMPILE else ! ! ! INSTALL_HEADERS = $(addprefix $(DJGPPDIR_U)/,$(wildcard include/ccom/*.h)) ! ! INSTALL_FILES = $(SYSTEM_LIB_DIR)/$(LIB_BASENAME) \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(SYSTEM_INCLUDE_DIR)/ccom \ ! $(INSTALL_HEADERS) \ ! $(SYSTEM_INFO_DIR)/ccom$(INFO_SUFFIX) ! ! install: $(INSTALL_FILES) ! @echo The $(DESCRIPTION) djgpp library has been installed. ! ! UNINSTALL_FILES = $(SYSTEM_LIB_DIR)/libccom.a $(SYSTEM_LIB_DIR)/libccomd.a \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(SYSTEM_INFO_DIR)/ccom$(INFO_SUFFIX) ! ! uninstall: ! -rm -fv $(UNINSTALL_FILES) ! -rm -frv $(SYSTEM_INCLUDE_DIR)/ccom ! @echo All gone! ! ! ! ! # -------- Compile anything that can't be done in makefile.all. -------- ! ! # this section is empty ! ! ! # -------- Generate automatic dependencies. -------- ! ! DEPEND_PARAMS = $(GCC2DJGPP) -MM -MG -I. -I./include -DCCOM_SCAN_DEPEND ! ! depend: ! gcc $(DEPEND_PARAMS) src/*.c examples/*.c $(wildcard docs/*.c src/misc/*.c) > _depend.tmp ! sed -e "s/^\([a-zA-Z0-9_]*\.o:\)/obj\/djgpp\/ccom\/\1/" _depend.tmp > obj/djgpp/ccom/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\.o:\)/obj\/djgpp\/ccomd\/\1/" _depend.tmp > obj/djgpp/ccomd/makefile.dep ! rm _depend.tmp Index: makefile.vc =================================================================== RCS file: /cvsroot/ccomx/ccom/misc/makefile.vc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** makefile.vc 21 Jun 2004 19:17:54 -0000 1.10 --- makefile.vc 8 Nov 2004 21:15:21 -0000 1.11 *************** *** 1,318 **** ! # makefile.vc: ! # Makefile for the CCOM library with MSVC. Should not be used directly! ! # ! # By Christer Sandberg (ported from Adime made by Sven Sandberg). ! # See readme.txt for more information about CCOM. ! # See makefile.all for a list of the available targets. ! # ! # ! # To path MSVC so it can be used from the commandline, run the ! # vcvars32.bat file which can be found in your MSVC bin directory. ! # ! # This build uses djgpp for calculating ! # source dependencies, so you'll need to have that installed as well. ! # ! # The "depend" target uses sed. ! ! # -------- define some variables that the primary makefile will use -------- ! ! PLATFORM = MSVC ! ! EXE_SUFFIX = .exe ! OBJ_SUFFIX = .obj ! LIB_SUFFIX = .lib ! HTML_SUFFIX = .html ! INFO_SUFFIX = .info ! TEXI_SUFFIX = .texi ! ! _TX_HTML_FLAG = -html ! _TX_TEXI_FLAG = -texi ! ! ifndef OBJ_ROOT_DIR ! OBJ_ROOT_DIR = obj ! OBJ_ROOT_DIR_D = obj ! endif ! OBJ_PLATFORM_ROOT_DIR = $(OBJ_ROOT_DIR)/msvc ! OBJ_PLATFORM_ROOT_DIR_D = $(OBJ_ROOT_DIR_D)\msvc ! ! ifndef LIB_ROOT_DIR ! LIB_ROOT_DIR = lib ! LIB_ROOT_DIR_D = lib ! endif ! LIB_DIR = $(LIB_ROOT_DIR)/msvc ! LIB_DIR_D = $(LIB_ROOT_DIR)\msvc ! ! ifdef STATICLINK ! # link as a static library ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE)_s ! OBJ_DIR_D = $(OBJ_PLATFORM_ROOT_DIR_D)\$(PACKAGE)_s ! IMPLIB_BASENAME = $(PACKAGE)_s$(LIB_SUFFIX) ! else ! # link as a DLL ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE) ! OBJ_DIR_D = $(OBJ_PLATFORM_ROOT_DIR_D)\$(PACKAGE) ! DLL_BASENAME = $(PACKAGE)$(LIB_VERSION).dll ! DLL_NAME = $(LIB_DIR)/$(DLL_BASENAME) ! IMPLIB_BASENAME = $(PACKAGE)$(LIB_SUFFIX) ! EXPDEF_NAME = $(LIB_DIR)/ccom.def ! endif ! ! IMPLIB_NAME = $(LIB_DIR)/$(IMPLIB_BASENAME) ! LIB_NAME = $(IMPLIB_NAME) ! ! # -------- Check that environment path variables are set. -------- ! ! .PHONY: badwin badmsvc badspaces ! ! ifeq ($(OS),Windows_NT) ! WINSYSDIR = $(SYSTEMROOT) ! ifeq ($(WINSYSDIR),) ! WINSYSDIR = $(SystemRoot) ! endif ! WINSUBDIR = system32 ! else ! WINSYSDIR = $(WINDIR) ! ifeq ($(WINSYSDIR),) ! WINSYSDIR = $(windir) ! endif ! WINSUBDIR = system ! endif ! ! ifneq ($(WINSYSDIR),) ! WINDIR_U = $(subst \,/,$(WINSYSDIR)/$(WINSUBDIR)) ! WINDIR_D = $(subst /,\,$(WINSYSDIR)/$(WINSUBDIR)) ! else ! badwin: ! @echo Your SYSTEMROOT or windir environment variable is not set! ! endif ! ! ifdef MSVCDIR ! MSVCDIR_U = $(subst \,/,$(MSVCDIR)) ! MSVCDIR_D = $(subst /,\,$(MSVCDIR)) ! else ! ifdef MSDEVDIR ! MSVCDIR_U = $(subst \,/,$(MSDEVDIR)) ! MSVCDIR_D = $(subst /,\,$(MSDEVDIR)) ! else ! badmsvc: ! @echo Your MSVCDIR or MSDEVDIR environment variable is not set! ! endif ! endif ! ! NULLSTRING := ! SPACE := $(NULLSTRING) # special magic to get an isolated space character ! ! ifneq ($(findstring $(SPACE),$(MSVCDIR)$(MSDEVDIR)),) ! badspaces: ! @echo There are spaces in your MSVCDIR or MSDEVDIR environment ! @echo variables: please change these to the 8.3 short filename ! @echo version, or move your compiler to a different directory. ! endif ! ! SYSTEM_INCLUDE_DIR = $(MSVCDIR_U)/include ! SYSTEM_INCLUDE_DIR_D = $(MSVCDIR_D)\include ! SYSTEM_LIB_DIR = $(MSVCDIR_U)/lib ! SYSTEM_LIB_DIR_D = $(MSVCDIR_D)\lib ! ! # -------- Set up mktext -------- ! ifdef UNIX_TOOLS ! ALLEGRO_DAT = $(subst \,/,$(ALLEGRO_DAT_X)) ! CGUI_DAT2C = $(subst /,\,$(CGUI_DAT2C_X)) ! CCOM_DAT = $(subst /,\,$(CCOM_DAT_X)) ! CCOM_DAT_C = $(subst \,/,$(CCOM_DAT_C_X)) ! CCOM_DAT_H = $(subst \,/,$(CCOM_DAT_H_X)) ! CCOM_LABELS = $(subst \,/,$(CCOM_LABELS_X)) ! TEXT_SOURCES = $(subst \,/,$(TEXT_SOURCES_X)) ! TEXT_HEADERS = $(subst \,/,$(TEXT_HEADERS_X)) ! MKTEXT = $(subst \,/,$(MKTEXT_X)) ! else ! ALLEGRO_DAT = $(subst /,\,$(ALLEGRO_DAT_X)) ! CGUI_DAT2C = $(subst /,\,$(CGUI_DAT2C_X)) ! CCOM_DAT = $(subst /,\,$(CCOM_DAT_X)) ! CCOM_DAT_C = $(subst /,\,$(CCOM_DAT_C_X)) ! CCOM_DAT_H = $(subst /,\,$(CCOM_DAT_H_X)) ! CCOM_LABELS = $(subst /,\,$(CCOM_LABELS_X)) ! TEXT_SOURCES = $(subst /,\,$(TEXT_SOURCES_X)) ! TEXT_HEADERS = $(subst /,\,$(TEXT_HEADERS_X)) ! MKTEXT = $(subst /,\,$(MKTEXT_X)) ! endif ! ! RUNNER = $(CGUIDIR)/obj/msvc/runner$(EXE_SUFFIX) ! ! .PHONY: _default ! ! _default: default ! ! # -------- decide what compiler options to use -------- ! ! ifdef WARNMODE ! WFLAGS = -W3 -WX ! else ! WFLAGS = -W1 ! endif ! ! ifdef DEBUGMODE ! # -------- debugging build -------- ! CFLAGS = -DDEBUGMODE=$(DEBUGMODE) $(WFLAGS) -Gd -Zi -MDd ! SFLAGS = -DDEBUGMODE=$(DEBUGMODE) -Wall ! LFLAGS = -debug -debugtype:cv ! ifdef STATICLINK ! LIB_FLAGS = cgui_s.lib alld_s.lib ! else ! LIB_FLAGS = cgui.lib alld.lib ! endif ! else ! ifdef PROFILEMODE ! # -------- profiling build -------- ! CFLAGS = $(WFLAGS) -Gd -Ox -GB -MD ! SFLAGS = -Wall ! LFLAGS = -profile ! ifdef STATICLINK ! LIB_FLAGS = cgui_s.lib allp_s.lib ! else ! LIB_FLAGS = cgui.lib allp.lib ! endif ! else ! # -------- optimised build -------- ! CFLAGS = $(WFLAGS) -Gd -Ox -GB -MD ! SFLAGS = -Wall ! LFLAGS = -release ! ifdef STATICLINK ! LIB_FLAGS = cgui_s.lib alleg_s.lib ! else ! LIB_FLAGS = cgui.lib alleg.lib ! endif ! endif ! endif ! ! ifdef CCOM_DEVELOPING ! CFLAGS += -D_CCOM_DEVELOPING=1 ! endif ! ifdef CCOM_FORTIFY ! CFLAGS += -D_CCOM_FORTIFY=1 -DFORTIFY ! endif ! ! CFLAGS_NO_OPTIMIZE = $(WFLAGS) -Gd -MT ! ! COMPILE_FLAGS = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS) ! COMPILE_FLAGS_NO_OPTIMIZE = $(subst src/,-DCCOM_SRC ,$(findstring src/, $<))$(CFLAGS_NO_OPTIMIZE) ! ! ifdef STATICLINK ! COMPILE_FLAGS += -DCCOM_STATICLINK -DCGUI_STATICLINK -DALLEGRO_STATICLINK ! endif ! ! LIB_FLAGS += kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib \ ! dinput.lib ddraw.lib dxguid.lib winmm.lib dsound.lib ! ! # -------- List platform specific objects and programs. -------- ! ! VPATH += ! ! OBJ_LIST = $(COMMON_OBJS) ! ! # Insert names of targets to build platform specific programs here. ! PROGRAMS = ! # Insert targets to build platform specific programs here. ! # myprogram: path/myprogram$(EXE_SUFFIX) ! ! ! # -------- Define how to compile. -------- ! ! GCC2MSVC = -D_MSC_VER -D_WIN32 -D_M_IX86 -U__GNUC__ -UDJGPP -U__unix__ ! ! define COMPILE_C_TO_OBJ ! $(RUNNER) cl @ -nologo $(COMPILE_FLAGS) -I./include -Fo$@ -c $< ! endef ! ! define LINK_OBJ_TO_EXE ! $(RUNNER) link @ -nologo $(LFLAGS) -subsystem:windows -out:$@ $< $(IMPLIB_NAME) $(LIB_FLAGS) ! endef ! ! ifdef STATICLINK ! # link as a static library ! define LINK_OBJ_TO_LIB ! $(RUNNER) lib @ -nologo -out:$(LIB_NAME) $(LIB_OBJS) ! endef ! else ! # link as a DLL ! define LINK_OBJ_TO_LIB ! $(RUNNER) link @ -nologo $(LFLAGS) -dll -def:$(EXPDEF_NAME) -out:$(DLL_NAME) -implib:$(IMPLIB_NAME) $(LIB_OBJS) $(LIB_FLAGS) ! endef ! endif # ifdef STATICLINK ! ! # -------- Rules for installing and removing the library files. -------- ! ! ifneq ($(wildcard $(DJDIR)/bin/cp.exe),) ! HAVE_CP = 1 ! endif ! ! ifndef STATICLINK ! $(WINDIR_U)/$(DLL_BASENAME): $(DLL_NAME) ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! endif ! ! $(SYSTEM_LIB_DIR)/$(IMPLIB_BASENAME): $(IMPLIB_NAME) ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! ! $(SYSTEM_INCLUDE_DIR)/ccom.h: include/ccom.h ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! ! $(SYSTEM_INCLUDE_DIR)/ccom: ! md $(subst /,\,$@) ! ! $(SYSTEM_INCLUDE_DIR)/ccom/%.h: include/ccom/%.h include/ccom ! ifdef HAVE_CP ! $(DJDIR)/bin/cp $(subst \,/,$< $@) ! else ! copy $(subst /,\,$< $@) ! endif ! ! ! INSTALL_HEADERS = $(addprefix $(MSVCDIR_U)/,$(wildcard include/ccom/*.h)) ! ! INSTALL_FILES = $(SYSTEM_LIB_DIR)/$(IMPLIB_BASENAME) \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(SYSTEM_INCLUDE_DIR)/ccom \ ! $(INSTALL_HEADERS) ! ! ifndef STATICLINK ! INSTALL_FILES += $(WINDIR_U)/$(DLL_BASENAME) ! endif ! ! install: $(INSTALL_FILES) ! @echo The $(DESCRIPTION) MSVC library has been installed. ! ! UNINSTALL_FILES = \ ! $(SYSTEM_LIB_DIR)/ccom.lib $(SYSTEM_LIB_DIR)/ccom_s.lib \ ! $(SYSTEM_LIB_DIR)/ccomd.lib $(SYSTEM_LIB_DIR)/ccomd_s.lib \ ! $(SYSTEM_INCLUDE_DIR)/ccom.h \ ! $(WINDIR_U)/ccom$(LIB_VERSION).dll $(WINDIR_U)/ccomd$(LIB_VERSION).dll ! ! uninstall: ! -rm -fv $(UNINSTALL_FILES) ! -rm -frv $(SYSTEM_INCLUDE_DIR)/ccom ! @echo All gone! ! ! # -------- Generate automatic dependencies. -------- ! ! DEPEND_PARAMS = $(GCC2MSVC) -MM -MG -I./include -DCCOM_SCAN_DEPEND ! ! depend: ! gcc $(DEPEND_PARAMS) src/*.c examples/*.c $(wildcard docs/*.c src/misc/*.c) > _depend.tmp ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/ccom\/\1\.obj:/" _depend.tmp > obj/msvc/ccom/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/ccomd\/\1\.obj:/" _depend.tmp > obj/msvc/ccomd/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/ccom_s\/\1\.obj:/" _depend.tmp > obj/msvc/ccom_s/makefile.dep ! sed -e "s/^\([a-zA-Z0-9_]*\)\.o:/obj\/msvc\/ccomd_s\/\1\.obj:/" _depend.tmp > obj/msvc/ccomd_s/makefile.dep ! rm _depend.tmp --- 1,318 ---- ! # makefile.vc: ! # Makefile for the CCOM library with MSVC. Should not be used directly! ! # ! # By Christer Sandberg (ported from Adime made by Sven Sandberg). ! # See readme.txt for more information about CCOM. ! # See makefile.all for a list of the available targets. ! # ! # ! # To path MSVC so it can be used from the commandline, run the ! # vcvars32.bat file which can be found in your MSVC bin directory. ! # ! # This build uses djgpp for calculating ! # source dependencies, so you'll need to have that installed as well. ! # ! # The "depend" target uses sed. ! ! # -------- define some variables that the primary makefile will use -------- ! ! PLATFORM = MSVC ! ! EXE_SUFFIX = .exe ! OBJ_SUFFIX = .obj ! LIB_SUFFIX = .lib ! HTML_SUFFIX = .html ! INFO_SUFFIX = .info ! TEXI_SUFFIX = .texi ! ! _TX_HTML_FLAG = -html ! _TX_TEXI_FLAG = -texi ! ! ifndef OBJ_ROOT_DIR ! OBJ_ROOT_DIR = obj ! OBJ_ROOT_DIR_D = obj ! endif ! OBJ_PLATFORM_ROOT_DIR = $(OBJ_ROOT_DIR)/msvc ! OBJ_PLATFORM_ROOT_DIR_D = $(OBJ_ROOT_DIR_D)\msvc ! ! ifndef LIB_ROOT_DIR ! LIB_ROOT_DIR = lib ! LIB_ROOT_DIR_D = lib ! endif ! LIB_DIR = $(LIB_ROOT_DIR)/msvc ! LIB_DIR_D = $(LIB_ROOT_DIR)\msvc ! ! ifdef STATICLINK ! # link as a static library ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE)_s ! OBJ_DIR_D = $(OBJ_PLATFORM_ROOT_DIR_D)\$(PACKAGE)_s ! IMPLIB_BASENAME = $(PACKAGE)_s$(LIB_SUFFIX) ! else ! # link as a DLL ! OBJ_DIR = $(OBJ_PLATFORM_ROOT_DIR)/$(PACKAGE) ! OBJ_DIR_D = $(OBJ_PLATFORM_ROOT_DIR_D)\$(PACKAGE) ! DLL_BASENAME = $(PACKAGE)$(LIB_VERSION).dll ! DLL_NAME = $(LIB_DIR)/$(DLL_BASENAME) ! IMPLIB_BASENAME = $(PACKAGE)$(LIB_SUFFIX) ! EXPDEF_NAME = $(LIB_DIR)/ccom.def ! endif ! ! IMPLIB_NAME = $(LIB_DIR)/$(IMPLIB_BASENAME) ! LIB_NAME = $(IMPLIB_NAME) ! ! # -------- Check that environment path variables are set. -------- ! ! .PHONY: badwin badmsvc badspaces ! ! ifeq ($(OS),Windows_NT) ! WINSYSDIR = $(SYSTEMROOT) ! ifeq ($(WINSYSDIR),) ! WINSYSDIR = $(SystemRoot) ! endif ! WINSUBDIR = system32 ! else ! WINSYSDIR = $(WINDIR) ! ifeq ($(WINSYSDIR),) ! WINSYSDIR = $(windir) ! endif ! WINSUBDIR = system ! endif ! ! ifneq ($(WINSYSDIR),) ! WINDIR_U = $(subst \,/,$(WINSYSDIR)/$(WINSUBDIR)) ! WINDIR_D = $(subst /,\,$(WINSYSDIR)/$(WINSUBDIR)) ! else ! badwin: ! @echo Your SYSTEMROOT or windir environment variable is not set! ! endif ! ! ifdef MSVCDIR ! MSVCDIR_U = $(subst \,/,$(MSVCDIR)) ! MSVCDIR_D = $(subst /,\,$(MSVCDIR)) ! else ! ifdef MSDEVDIR ! MSVCDIR_U = $(subst \,/,$(MSDEVDIR)) ! MSVCDIR_D = $(subst /,\,$(MSDEVDIR)) ! else ! badmsvc: ! @echo Your MSVCDIR or MSDEVDIR environment variable is not set! ! endif ! endif ! ! NULLSTRING := ! SPACE := $(NULLSTRING) # special magic to get an isolated space character ! ! ifneq ($(findstring $(SPACE),$(MSVCDIR)$(MSDEVDIR)),) ! badspaces: ! @echo There are spaces in your MSVCDIR or MSDEVDIR environment ! @echo variables: please change these to the 8.... [truncated message content] |