64-bit fixes.
[AROS-Contrib.git] / scalos / rules.mk
blob2d2d716e64103fca7e1235796992b14a618d47bc
1 # $Date: 2009-03-12 21:32:16 +0100 (Do, 12. Mär 2009) $
2 # $Revision: 97 $
3 #############################################################
5 .PHONY: __default_rule clean install nodebug \
6 all_subdirs clean_subdirs install_subdirs nodebug_subdirs
8 __default_rule: all
10 .SUFFIXES: .o
12 define run-cc
13 $(ECHO) "Compile $(notdir $<)"
14 $(CC) $(DEFINES) $(CFLAGS) -c $< -o $(OBJDIR)/$*.o
15 endef
17 #define run-cc-deps
18 #$(ECHO) "Compile $(notdir $<)"
19 #$(CC) $(DEFINES) $(CFLAGS) -c $< -o $(OBJDIR)/$*.o
20 #$(CC) -MM $(DEFINES) $(CFLAGS) -c $*.c -o $(OBJDIR)/$*.d
21 #$(FIXDEPS) $(OBJDIR)/$*.d
22 #endef
24 define build_subdir
25 $(MAKE) -s --directory=$(1) --file="makefile-new" TOPLEVEL="$(TOPLEVEL)" $(patsubst %_subdirs,%,$@);
26 endef
28 $(OBJDIR)/%.d :: %.c
29 -@$(ECHO) "Update dependencies for $<"; \
30 set -e; rm -f $@; \
31 $(CC) -MM $(DEFINES) $(CFLAGS) $< > $@.$$$$; \
32 sed 's,\($*\)\.o[ :]*,$(OBJDIR)/\1.o $@ : ,g' < $@.$$$$ > $@; \
33 rm -f $@.$$$$
36 $(OBJDIR)/%.o: %.c
37 @$(run-cc)
39 $(OBJDIR)/%.o : %.asm
40 @$(ECHO) "Assemble $<"
41 @$(AS) $(ASFLAGS) $< TO $(OBJDIR)/$*.obj
42 @hunk2aout $(OBJDIR)/$*.obj >/dev/null
43 @mv obj.0000.* $@
45 $(OBJDIR)/%.o : %.s
46 @$(ECHO) "Assemble $<"
47 @$(AS) $(ASFLAGS) $< TO $(OBJDIR)/$*.obj
48 @hunk2aout $(OBJDIR)/$*.obj >/dev/null
49 @mv obj.0000.* $@
51 nodebug:
52 -@splat -s -o "d2(" "d1(" "#?.c"
54 all_subdirs clean_subdirs install_subdirs nodebug_subdirs:
55 @$(foreach subdir,$(SUBDIRS),$(call build_subdir,$(subdir))) true