Submakefile.skel
1 # This is a skeleton makefile for a subdirectory 2 3 # FOOSRCS is a nice way to collect some source file names. Use $(patsubst) or 4 # $(addprefix) if you are listing a bunch of files from a subdirectory and 5 # would like to save a few keystrokes. 6 FOOSRCS := \ 7 path/src.cc 8 USERSRCS += $(FOOSRCS) 9 10 # This next line causes things in FOOSRCS to be compiled with an extra 11 # preprocessor symbol defined. EXTRAFLAGS can be used to specify any C 12 # compiler flag. 13 $(call TOOBJSDEPS, $(FOOSRCS)) : EXTRAFLAGS = -Dfoo 14 15 # This is how the binary 'foo' is linked. 16 ../bin/foo: $(call TOOBJS, $(FOOSRCS)) ../lib/libemc.a ../lib/libnml.so.0 17 $(CXX) -o $@ $^ 18 userspace: ../bin/foo 19 20 # See emc/rs274ngc/Submakefile for an example of creating a shared library 21 # or allowing headers to be copied to ../include. 22 23 # See rtapi/Submakefile for an example of how to make some other kind of 24 # file (in this case, ../scripts/rtapi.conf)