home *** CD-ROM | disk | FTP | other *** search
-
- Adj == Adjust DMakefile
-
- 5/25/93
-
- Chris Hind Genly
-
- Eggplant Software Tools
-
- chris@Eggplant.New-Haven.CT.US
-
-
-
- Adj was written to allow Amiga UUCP developers using different compilers
- to easily exchange DMakefiles. It can convert a DMakefile which uses DICE
- to a DMakefile which uses SASC, and back again.
-
- Adj performs two primary functions. It translates compiler options, and
- it provides conditionals.
-
- For adj to work effectively, some simple conventions must be followed.
- However, most of the uucp dmakefiles will work with only small changes.
-
-
- COMMAND LINE
- ------------
-
- adj <switches> [<files>]
-
- <files>:
- The names of DMakefiles to adjust. Default is 'DMakefile'
-
- <switches>:
-
- -dice Adjust the dmakefile so it will use the DICE compiler.
- -sasc Adjust the dmakefile so it will use SAS compiler.
- -force Normally when an unrecogized option is encountered in a
- dmakefile, adjustment is aborted, and the dmakefile is
- unchanged. This option will cause the dmakefile to be changed
- and to throw away the unrecognized option.
-
-
- ADJUSTED LINES
- --------------
-
- Adj will adjust lines starting with the following. White space
- is ignored.
-
- dcc
- sc
- CFLAGS =
- LIBS =
-
- Anything following these are considered dcc, or sc options, macro
- invocations or file names. These options will be adjusted for the
- requested compiler.
-
- When the -sasc switch is given, dcc is converted to sc. When the -dice
- switch is given sc is converted to dcc.
-
-
- OPTIONS
- -------
-
- Here are a list of related dcc and sc options known to adj.
-
- For adj to work correctly '-c' must occur on the dcc line, not in the
- CFLAGS macro. 'Link' must occur on the sc line, not in the CFLAGS macro.
-
- AdjustMakefile does not know about all compiler options. For example
- it does not know dcc's -I0, -L, -L0, -U, -H, -O, or rom options.
-
- sc dcc
- ------------ ------------
- AddSymbols -s
- ANSI // Always added to sc line.
- Code near -mc
- Code far -mC
- CPU 68020 -020
- CPU 68030 -030
- Data near -md
- Data far -mD
- Define name=val -D name=val
- IDIR dir -I dir
- Library file -l file
- Link (-c missing)
- Math 68881 -881
- Math 68882 -882
- NoIcons // Always added to sc line.
- ObjectName file -o file (-c present)
- ProgramName file -o file (-c missing)
- StackExtend -gs
- Startup=cres -r
- Verbose -v
-
- CONDITINALS
- -----------
-
- A conditional starts with the line '#for <compiler>' and ends with
- the line '#end'. <compiler> may be SASC or DICE.
-
- The lines between the '#for <compiler>' and '#end' are commented out if
- <compiler> does match that designated on the command line. If it does
- match, the lines are uncommented.
-
- Here's an example from the DMakefile for the uucp library.
-
- #for DICE
- $(EXE) : $(OBJS)
- cd $(OD)
- join $(LOBJ1) as ram:j1
- join $(LOBJ2) as ram:j2
- join $(LOBJ3) as ram:j3
- join $(LOBJ4) as ram:j4
- join $(LOBJ5) as ram:j5
- join $(LOBJ6) as ram:j6
- join $(LOBJ7) as ram:j7
- join $(LOBJ8) as ram:j8
- join ram:j1 ram:j2 ram:j3 ram:j4 ram:j5 ram:j6 ram:j7 ram:j8 as %(left)
- delete ram:j1 ram:j2 ram:j3 ram:j4 ram:j5 ram:j6 ram:j7 ram:j8 QUIET
- cd
- #end
-
- #for SASC
- #$(EXE) : $(OBJS)
- # cd $(OD)
- # -delete %(left)
- # echo $(LOBJ1) >oml_in.tmp
- # echo $(LOBJ2) >>oml_in.tmp
- # echo $(LOBJ3) >>oml_in.tmp
- # echo $(LOBJ4) >>oml_in.tmp
- # echo $(LOBJ5) >>oml_in.tmp
- # echo $(LOBJ6) >>oml_in.tmp
- # echo $(LOBJ7) >>oml_in.tmp
- # echo $(LOBJ8) >>oml_in.tmp
- # oml %(left) r @oml_in.tmp
- # delete oml_in.tmp
- # cd
- #end
-
- Conventions
- -----------
-
- 1) Put all compiler options on lines starting with the following.
-
- dcc
- sc
- CFLAGS=
- LIBS =
-
- 2) Use the following options on only a dcc line:
- -c
- -o
-
- 3) Use the following options only on an sc line:
- Link
- ObjectName
- ProgramName
-
- 4) Do not use compiler options adj doesn't understand.
-
- 5) Don't use the dcc -L option. Instead use -l option with a full path
- to the desired library. The path should include the .lib extension.
-
-
- For example, don't use
-
- LIBS = -L uucp:src/dlib -l uucp
-
- Use
-
- LIBS= -l uucp:src/dlib/uucp.lib
-
- This will correctly translate to the SASC version of
-
- LIBS= Library=uucp:src/dlib/uucp.lib
-
- The reason for this convention is sc does not have the equivalent of
- the dcc -L switch. The -L switch specifies a directory to search to
- locate a library. However the SASC Library option is very close to the
- DICE -l option. The Library option requires a full path to the
- library. -l will accept full paths. So avoid -L and use -l with an
- explicit path.
-