Revision 3fd422ff

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)
subdir.mak
19 19
INCINSTDIR := $(INCDIR)/lib$(NAME)
20 20

  
21 21
define RULES
22
$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
23
	$(CC) $(FFLDFLAGS) -o $$@ $$^ $(SUBDIR)$(LIBNAME) $(FFEXTRALIBS)
24

  
25
$(SUBDIR)%-test.o: $(SUBDIR)%.c
26
	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
27

  
28
$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
29
	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
30

  
31
$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
32
	$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
33

  
34
$(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
35
	$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
36

  
37
clean::
38
	rm -f $(EXAMPLES) $(addprefix $(SUBDIR),*-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
39
	    $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
40

  
41
distclean:: clean
42
	rm -f  $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
43
            $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
44

  
22 45
ifdef BUILD_SHARED
23 46
all: $(SUBDIR)$(SLIBNAME)
24 47

  
......
72 95
endef
73 96

  
74 97
$(eval $(RULES))
98

  
99
examples: $(EXAMPLES)
100
testprogs: $(TESTPROGS)

Also available in: Unified diff