Zeavon wrote: > I'm in the midst of shuffling structs around between .h files so that > things will be a little more organized (in my mind, at least). This means > that I'm adding some new .h files and, of course, I am also #include'ing > them into the code. To keep my Makefile up-to-date, I'm using 'gcc -MM > *.c' to get output on what .c files are dependant on what .h files. > > I'm getting out put like so: > act.comm.o: act.comm.c conf.h sysdep.h structs.h utils.h comm.h \ > interpreter.h handler.h db.h spells.h constants.h object.h room.h \ > char.h > act.info1.o: act.info1.c conf.h sysdep.h structs.h utils.h comm.h \ > interpreter.h handler.h db.h spells.h constants.h object.h room.h \ > char.h > [etc] > > But the Makefile needs input like so: > act.comm.o: act.comm.c conf.h sysdep.h structs.h utils.h comm.h \ > interpreter.h handler.h db.h spells.h constants.h object.h room.h > $(CC) -c $(CFLAGS) act.comm.c > act.info1.o: act.info1.c conf.h sysdep.h structs.h utils.h comm.h \ > interpreter.h handler.h db.h spells.h constants.h object.h room.h > $(CC) -c $(CFLAGS) act.info1.c > [etc] > > Does anyone have an easy way to add the $(CC) -c $(CFLAGS) .... line in > the appropriate plraces? > > Thanks! Try this handy little trick I use, it makes maintaining the Makefile 100 times easier... Junk all the depends in you rmakefile, just delete everything past the lines... # Dependencies for the object files (automagically generated with # gcc -MM) then replace it with the following (note <tab> is an actual tab character)... # Dependencies for the object files (automagically generated with # gcc -MM) depend: <tab>$(CC) -MM *.c > depend -include depend Voila! You never have to worry about depends again! They're automatically generated for you! Oh, and btw, whenever messing with the Makefile, ALWAYS make your changes to Makefile.in and then run ./configure, if you neglect to change Makefile.in then next time you run ./configure for any reason all your Makefile changes will be lost. Regards, Peter +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST