#file for $(MAKE) rules and stuff $(OBJDIR): mkdir $(OBJDIR) #rules for building files OBJECTS_TARGETS = $(addprefix $(OBJDIR)/,$(OBJECTS)) OBJECTS_DONT_LINK_TARGETS = $(addprefix $(OBJDIR)/,$(OBJECTS_DONT_LINK)) RESOURCES_TARGETS = $(addprefix $(LIBDIR)/,$(RESOURCES)) $(OBJDIR)/%.o: %.c $(CC) $(CFLAGS) $(E_CFLAGS) -o $@ $< $(OBJDIR)/%.o: %.cpp $(CXX) $(CFLAGS) $(E_CFLAGS) -o $@ $< $(OBJDIR)/%.o: %.asm $(NASM) $< -o $@ $(OBJDIR)/%.o: %.s $(CC) $(CFLAGS) $(patsubst %.s,%.S,$<) -o $@ $(LIBDIR)/%.$(OBJ): %.rc windres --include include -o $@ $< #rules for going into subdirs ifdef SUBDIRS .PHONY:$(SUBDIRS) $(SUBDIRS): $(MAKE) -C $@ ifdef ENV_LINUX FOR=set -e; for I in DO=; do DONE=$$I;done else ifeq ($(findstring /,$(SHELL)),/) FOR=set -e; for I in DO=; do DONE=$$I;done else FOR=for %%I in ( DO=) do DONE=%%I endif endif endif DOSUBS=$(FOR) $(SUBDIRS) $(DO) $(MAKE) -C $(DONE) ifdef SUBDIRS CLEANSUBS=$(FOR) $(SUBDIRS) $(DO) $(MAKE) clean -C $(DONE) DEPSUBS=$(FOR) $(SUBDIRS) $(DO) $(MAKE) -k depend -C $(DONE) endif