make.diff 1.3 KB

1234567891011121314151617181920212223
  1. diff --git a/makefile b/makefile
  2. index bd93acfa..e76d84c6 100644
  3. --- a/makefile
  4. +++ b/makefile
  5. @@ -1,8 +1,9 @@
  6. MAKE:=$(MAKE) MAKEFLAGS=-j8
  7. M=mkdir -p $(@D)
  8. 0:;$(MAKE) k && $(MAKE) t #default target
  9. -k:;$(MAKE) a N=$@ R=k O='-O3 -march=native' L='-lm -ldl' #for calling k from dynamic libs, add: L='... -Wl,-E'
  10. -libk.so:;$(MAKE) a N=$@ R=$@ O='-fPIC -Dshared -fvisibility=hidden' L='-lm -ldl -shared'
  11. +k:;$(MAKE) a N=$@ R=k O='-g -march=native' L='-lm -ldl' #for calling k from dynamic libs, add: L='... -Wl,-E'
  12. +libk.so:;$(MAKE) a N=$@ R=$@ O='-g -fPIC -Dshared -fvisibility=hidden' L='-lm -ldl -shared'
  13. +libk.dylib:;$(MAKE) a N=$@ R=$@ O='-fPIC -Dshared -fvisibility=hidden' L='-lm -ldl -dynamiclib -install_name $@'
  14. libk.a:;$(MAKE) b N=$@ R=$@ O='-O3 -march=native -ffreestanding -lm -ldl -Dldstatic'
  15. o/$N/%.o:%.c *.h;$M;$(CC) @opts $O -o $@ -c $<
  16. o/$N/bin:$(patsubst %.c,o/$N/%.o,$(wildcard *.c));$(CC) $O -o $@ $^ @lopts $L # ;$(STRIP) -R .comment $@ -R '.note*'
  17. @@ -54,5 +55,5 @@ t21:k;l/runparts.k aoc/21 ;echo t21 done
  18. t22:k;l/runparts.k aoc/22 ;echo t22 done
  19. t23:k;l/runparts.k aoc/23 ;echo t23 done
  20. -c:;rm -rf o k libk.so libk.a #clean
  21. +c:;rm -rf o k libk.dylib libk.a #clean
  22. .PHONY: 0 c k w h a t tu td tg te te0 te1 te2 ta t15 t16 t17 t18 t19 t20 t21 t22 t23