Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!snorkelwacker!mit-eddie!rutgers!att!drutx!druwy!mab From: mab@druwy.ATT.COM (Alan Bland) Newsgroups: comp.sys.amiga Subject: Re: Lattice C Power Windows Summary: makefile enclosed Message-ID: <4488@druwy.ATT.COM> Date: 9 Dec 89 17:06:05 GMT References: <[2577758d:2917]comp.sys.amiga@tronsbox.UUCP> Organization: AT&T, Denver, CO Lines: 79 With all the talk about Power Windows not putting Image data in chip RAM for Lattice 5.0x, I thought I'd share the makefile I use when I'm programming with Power Windows 2.5 and Lattice 5.04. It automagically edits the code generated by Power Windows to add the chip keyword at the appropropriate spots, and it also creates a header file containing extern definitions of some of the PW-generated structures. I offer this makefile with NO promise to support it (it took me enough time to figure out how to use Commodore's "edit" program, maybe I should find "sed" somewhere). This is a makefile from a specific project that uses only Windows and Gadgets, I do NOT use the PW-generated driver, I use the ARP 1.3 Ashell with the BCPL escape char set to a backslash, and probably a whole bunch of other things that will keep this from working perfectly for you the first time. You probably also will not like my choice of compiler and linker options. Aside from all that, it's worked great for me for many different projects. Enough said. Here it is. Enjoy! ## ## TARGET is the name of the final executable file. ## OBJECT is a list of all object files to be included. ## PW is the basename (without extension) of the Power Windows files: ## $(PW).pw is the PW definition file ## $(PW).out is the source code generated by PW ## $(PW).c is the Lattice 5 source code created from $(PW).out ## $(PW).h is the extern defs created from $(PW).out ## TARGET = gr OBJECT = grmain.o grpw.o grwin.o PW = grpw all : $(TARGET) ## ## Set CDEBUG and LDEBUG to appropriate debug options for compile and link. ## # CDEBUG = -d5 # LDEBUG = addsym CDEBUG = LDEBUG = nodebug ## ## Default compiler rule. ## .c.o : lc:lc1 -. $(CDEBUG) -cf -cs -oram: $* lc:lc2 -. -v -o$*.o ram:$* ## ## Rule to create Lattice 5 Power Windows source and header file. ## For each NewWindowStructure in the file, duplicate the echo line ## listed below to name the structure what you want (or delete it ## if you prefer to use the PW-generated names). If you use other ## structs that need to be declared extern, modify the appropriate ## edit commands below. ## $(PW).c : $(PW).out copy $(PW).out t:t0 echo >t:t1 "gb/struct Gadget/extern /;gb/struct NewWindow/extern /;ge/ = {/;/;0(df/extern/;n)" edit t:t0 to t:t2 with t:t1 opt w200 echo >>t:t2 "\#define NewWindowGraph NewWindowStructure1" copy t:t2 $(PW).h echo >t:t1 "ge/USHORT Image/USHORT chip Image/" edit t:t0 to t:t2 with t:t1 opt w200 echo >$(PW).c "\#include " type >>$(PW).c t:t2 delete t:t0 t:t1 t:t2 ## ## Rule to create the target. The first dependency should be $(PW).c ## if Power Windows has been used to create the Intuition structures. ## $(TARGET) : $(PW).c $(OBJECT) lc:blink to $(TARGET) from lib:c.o $(OBJECT) batch $(LDEBUG) \ lib lib:lcm.lib lib:lc.lib lib:amiga.lib -- -- Alan Bland -- att!druwy!mab == mab@druwy.ATT.COM -- AT&T Bell Laboratories, Denver CO -- (303)538-3510 "Musicians do it in the MIDI of the night"