# -*- makefile -*- # build rules. this compiles source files in $(SRCDIR)/$(MODULE) # and places the resulting objects in the current dir # should be included only once at the end of each dir's Makefile # make deps from c/c++ file %.d: $(SRCDIR)/$(MODULE)/%.$(CEXT) echo "$(MODULE)/$@" set -e; rm -f $@; \ $(COMPILE_COMPONENT) -M $(CPPFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ # make object from c file %.o: $(SRCDIR)/$(MODULE)/%.$(CEXT) echo "$(MODULE)/$@" $(COMPILE_COMPONENT) $(CPPFLAGS) $(CFLAGS) $(OPTI_CFLAGS) $(DEBUG_CFLAGS) -o $@ -c $< 2>>$(LOG) target: $(TARGET) install: $(TARGET) install -m 755 $(TARGET) $(TARGET_DIR) 2>>$(LOG) #clean: # rm -f *.o *.so *.d *.d.* *~ # deps -include $(sources:.$(CEXT)=.d) objects = $(sources:.$(CEXT)=.o) # build target $(TARGET): $(objects) echo "$(MODULE)/$@" $(COMPILE_TARGET) $(LDFLAGS) $(objects) -o $@ 2>>$(LOG)