Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.atari.8bit > #337
| Message-ID | <4e7bbfa4$0$1681$742ec2ed@news.sonic.net> (permalink) |
|---|---|
| From | bill@newbreedsoftware.com (Bill Kendrick) |
| Subject | Re: Corrections to Sources |
| Newsgroups | comp.sys.atari.8bit |
| References | <19b2b380-3651-4da0-9de5-a65d50a4f717@v26g2000prh.googlegroups.com> |
| Date | 2011-09-22 23:07 +0000 |
| Organization | Sonic.Net |
ricortes <ricortes@earthlink.net> wrote: > When I took a C programming class it was back in the 80s. Honestly > looking at the make files in all their derivations I think they are > more sophisticated and more complex then anything C used to be. > Sheesh! I am trying to get back up to speed with the Cybiko SDK and > think I need to take a class in 'make file programming.' I had the > same gripe when working with cc65! I'm a VERY naiive "Make" user, but about 12+ years ago I got a copy of "Managing Projects with Make" by O'Reilly. Was pretty useful. My naiive use is basically: --- begin --- # Var. for where to install my app PREFIX=/usr/local # ... and its data DATA_PREFIX=($PREFIX)/share/my_app # Flags to send C compiler. Including a hard-coded (#define) value # that'll tell the app where to find its data. -Wall turns on 'all' warnings. CFLAGS=-Wall -DPREFIX="$(DATA_PREFIX)" # Default make target: build the app all: my_executable # Target for installing app and its data install: cp my_executable $(PREFIX)/bin/ cp -r data/ $(DATA_PREFIX)/ # Link the objects into the final executable my_executable: my_app.o some_other_funcs.o $(CC) ($LDFLAGS) my_app.o some_other_funcs.o -o my_executable # Create my main object my_app.o: my_app.c some_other_funcs.h # Make's default rule is sufficient; it'll come out as: # $(CC) my_app.c $(CFLAGS) -o my_app.o # Create object for some other functions some_other_funcs.o: some_other_funcs.c some_other_funcs.h # Ditto --- end --- Or, yknow, something like that. :) There's some insanely clever stuff you can get Make systems to do, but 99% of the time I just want it to handle dependencies and take care of some variables. For example, in the above case, on Linux a: $ sudo make install would install it into /usr/local/. But I could easily install it in the non-local place: $ make PREFIX=/usr $ sudo make install PREFIX=/usr or, like back when I was on a shared Unix (Solaris and SunOS) box in college, I could tell it I want things to run from somewhere in my homedir. (Notice I don't need to have root privileges -- no "sudo") $ make PREFIX=/home/kendrick/opt $ make install PREFIX=/home/kendrick/opt I'm rambling. :) -- -bill! Sent from my computer
Back to comp.sys.atari.8bit | Previous | Next — Previous in thread | Next in thread | Find similar
Corrections to Sources ricortes <ricortes@earthlink.net> - 2011-09-22 12:47 -0700
Re: Corrections to Sources bill@newbreedsoftware.com (Bill Kendrick) - 2011-09-22 23:07 +0000
Re: Corrections to Sources ricortes <ricortes@earthlink.net> - 2011-09-22 21:11 -0700
csiph-web