Revision 3fd422ff common.mak

View differences:

common.mak
81 81
DISTCLEANSUFFIXES = *.d *.pc
82 82
LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map
83 83

  
84
define RULES
85
$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
86
	$(CC) $(FFLDFLAGS) -o $$@ $$^ $(SUBDIR)$(LIBNAME) $(FFEXTRALIBS)
87

  
88
$(SUBDIR)%-test.o: $(SUBDIR)%.c
89
	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
90

  
91
$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
92
	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
93

  
94
$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
95
	$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
96

  
97
$(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
98
	$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
99

  
100
clean::
101
	rm -f $(EXAMPLES) $(addprefix $(SUBDIR),*-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
102
	    $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
103

  
104
distclean:: clean
105
	rm -f  $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
106
            $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
107
endef
108

  
109
$(eval $(RULES))
110

  
111
examples: $(EXAMPLES)
112
testprogs: $(TESTPROGS)
113

  
114 84
-include $(DEPS)

Also available in: Unified diff