Re: [Chicken-users] Incremental build, tricks or tips anyone?
From: Matthew Welland Subject: [Chicken-users] Incremental build, tricks or tips anyone? Date: Sun, 5 Sep 2010 14:52:24 -0700 > I am updating some old code and the build broke because chicken-config no > longer exists. It took a while but I finally found that all I had to do was > replace chicken-config with csc. I.e. "csc -cflags" in place of > "chicken-config > -cflags". > > My question is, does anyone have a nicer way of doing this? I sometimes work > on very weak machines such as single board computers and really appreciate > build times of seconds instead of minutes when only one file has changed. I think, you could simply use `csc': > > src_code := laedlib tc_laedlib re-route > scm_files := $(addprefix ../scm/,$(addsuffix .scm,$(src_code))) > c_files := $(addprefix src/,$(addsuffix .c,$(src_code))) > o_files := $(addprefix src/,$(addsuffix .o,$(src_code))) > > $(c_files): src/%.c: ../scm/%.scm ../scm/macros.scm > chicken $< -output-file $@ csc -t $< -o $@ > > $(o_files): src/%.o: src/%.c > gcc -c $< `chicken-config -cflags` -o $@ csc -c $< -o $@ > > $(src_code): %: src/%.o src/laedlib.o > gcc src/$*.o src/laedlib.o -o $* `chicken-config -libs` csc src/$*.o src/laedlib.o -o $* (I have not tested this) cheers, felix ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] Incremental build, tricks or tips anyone?
Matthew, Would it be possible for you to use the make macro that is built into setup-api (and therefore chicken-install), along with 'csc -t' for example to do the translation from .c to .o, rather than manually invoking gcc? csc can also be called in a separate step to link your object files together. And you should be able to obtain the names of your source files via scheme calls. Jim On Sep 5, 2010, at 16:52, Matthew Welland wrote: > I am updating some old code and the build broke because chicken-config no > longer exists. It took a while but I finally found that all I had to do was > replace chicken-config with csc. I.e. "csc -cflags" in place of > "chicken-config > -cflags". > > My question is, does anyone have a nicer way of doing this? I sometimes work > on very weak machines such as single board computers and really appreciate > build times of seconds instead of minutes when only one file has changed. > > src_code := laedlib tc_laedlib re-route > scm_files := $(addprefix ../scm/,$(addsuffix .scm,$(src_code))) > c_files := $(addprefix src/,$(addsuffix .c,$(src_code))) > o_files := $(addprefix src/,$(addsuffix .o,$(src_code))) > > $(c_files): src/%.c: ../scm/%.scm ../scm/macros.scm > chicken $< -output-file $@ > > $(o_files): src/%.o: src/%.c > gcc -c $< `chicken-config -cflags` -o $@ > > $(src_code): %: src/%.o src/laedlib.o > gcc src/$*.o src/laedlib.o -o $* `chicken-config -libs` > > ___ > Chicken-users mailing list > Chicken-users@nongnu.org > http://lists.nongnu.org/mailman/listinfo/chicken-users ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] Incremental build, tricks or tips anyone?
I am updating some old code and the build broke because chicken-config no longer exists. It took a while but I finally found that all I had to do was replace chicken-config with csc. I.e. "csc -cflags" in place of "chicken-config -cflags". My question is, does anyone have a nicer way of doing this? I sometimes work on very weak machines such as single board computers and really appreciate build times of seconds instead of minutes when only one file has changed. src_code := laedlib tc_laedlib re-route scm_files := $(addprefix ../scm/,$(addsuffix .scm,$(src_code))) c_files := $(addprefix src/,$(addsuffix .c,$(src_code))) o_files := $(addprefix src/,$(addsuffix .o,$(src_code))) $(c_files): src/%.c: ../scm/%.scm ../scm/macros.scm chicken $< -output-file $@ $(o_files): src/%.o: src/%.c gcc -c $< `chicken-config -cflags` -o $@ $(src_code): %: src/%.o src/laedlib.o gcc src/$*.o src/laedlib.o -o $* `chicken-config -libs` ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users