Revision 3fd422ff subdir.mak

View differences:

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