I needed to add a C function for the waves-in-a-circle problem. I believe the chunk of makefile you show does nothing at all. It's all in the functions. I added these to
https://github.com/kshedstrom/roms/blob ... n/makefile:
Code: Select all
# $(call source-to-object, source-file-list)
c-source-to-object = $(call source-dir-to-binary-dir, \
$(subst .c,.o,$(filter %.c,$1)) \
$(subst .cc,.o,$(filter %.cc,$1)))
# $(call make-c-library, library-name, source-file-list)
define make-c-library
libraries += $(SCRATCH_DIR)/$1
c_sources += $2
$(SCRATCH_DIR)/$1: $(call source-dir-to-binary-dir, \
$(subst .c,.o,$(filter %.c,$2)) \
$(subst .cc,.o,$(filter %.cc,$2)))
$(AR) $(ARFLAGS) $$@ $$^
$(RANLIB) $$@
endef
# $(call one-c-compile-rule, binary-file, source-file)
define one-c-compile-rule
$1: $2
cd $$(SCRATCH_DIR); $$(CXX) -c $$(CXXFLAGS) $$<
endef
Then in your compilers file you also need:
Code: Select all
CC := gcc
CXX := g++
CFLAGS :=
CXXFLAGS :=
Code: Select all
ifdef USE_DEBUG
FFLAGS += -g -fbounds-check
CFLAGS += -g
CXXFLAGS += -g
else
FFLAGS += -O3 -ffast-math
CFLAGS += -O3
CXXFLAGS += -O3
endif
Finally, you need to invoke the compiling of your C code. I forget how we did that before. It was for the Hong Kong workshop, files which are no longer being served by ARSC with the demise of ARSC. I can poke around later for them.