track: Fix a regression of wrongly getting aperture modes.
[L-SMASH.git] / Makefile
blob3d5b8b73de139ba2cff4464803734caa2606adf6
1 # Makefile for L-SMASH
3 # note:
4 # Currently, this Makefile is not tested except GNU make.
6 include config.mak
8 vpath %.c $(SRCDIR)
9 vpath %.h $(SRCDIR)
11 OBJS = $(SRCS:%.c=%.o)
13 SRC_ALL = $(SRCS) $(SRC_TOOLS)
15 #### main rules ####
17 .PHONY: all lib install install-lib clean distclean dep depend
19 all: $(STATICLIB) $(SHAREDLIB) $(TOOLS)
21 lib: $(STATICLIB) $(SHAREDLIB)
23 $(STATICLIBNAME): $(OBJS)
24 $(AR) rc $@ $^
25 $(RANLIB) $@
26 -@ $(if $(STRIP), $(STRIP) -x $@)
28 $(SHAREDLIBNAME): $(OBJS)
29 $(LD) $(SO_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
30 -@ $(if $(STRIP), $(STRIP) -x $@)
31 ifneq ($(SLIB_CMD),)
32 $(SLIB_CMD)
33 endif
34 ifeq ($(SHAREDLIBNAME), liblsmash.so.$(MAJVER))
35 ln -sf $(SHAREDLIBNAME) liblsmash.so
36 endif
38 # $(TOOLS) is automatically generated as config.mak2 by configure.
39 # The reason for having config.mak2 is for making this Makefile easy to read.
40 include config.mak2
42 %.o: %.c .depend config.h
43 $(CC) -c $(CFLAGS) -o $@ $<
45 install: all install-lib
46 install -d $(DESTDIR)$(bindir)
47 install -m 755 $(TOOLS) $(DESTDIR)$(bindir)
49 install-lib: liblsmash.pc lib
50 install -d $(DESTDIR)$(includedir)
51 install -m 644 $(SRCDIR)/lsmash.h $(DESTDIR)$(includedir)
52 install -d $(DESTDIR)$(libdir)/pkgconfig
53 install -m 644 liblsmash.pc $(DESTDIR)$(libdir)/pkgconfig
54 ifneq ($(STATICLIB),)
55 install -m 644 $(STATICLIB) $(DESTDIR)$(libdir)
56 endif
57 ifneq ($(SHAREDLIB),)
58 ifneq ($(IMPLIB),)
59 install -m 644 $(IMPLIB) $(DESTDIR)$(libdir)
60 install -d $(DESTDIR)$(bindir)
61 install -m 755 $(SHAREDLIB) $(DESTDIR)$(bindir)
62 ifneq ($(SLIB_CMD),)
63 install -m 644 $(DEFNAME) $(DESTDIR)$(libdir)
64 install -m 644 lsmash.lib $(DESTDIR)$(bindir)
65 endif
66 else
67 install -m 644 $(SHAREDLIB) $(DESTDIR)$(libdir)
68 ifeq ($(SHAREDLIB), liblsmash.so.$(MAJVER))
69 ln -sf $(SHAREDLIB) $(DESTDIR)$(libdir)/liblsmash.so
70 endif
71 endif
72 endif
74 #All objects should be deleted regardless of configure when uninstall/clean/distclean.
75 uninstall:
76 $(RM) $(DESTDIR)$(includedir)/lsmash.h
77 $(RM) $(addprefix $(DESTDIR)$(libdir)/, liblsmash.a liblsmash.dll.a liblsmash.so* liblsmash.dylib liblsmash*.def pkgconfig/liblsmash.pc)
78 $(RM) $(addprefix $(DESTDIR)$(bindir)/, $(TOOLS_ALL) $(TOOLS_ALL:%=%.exe) liblsmash*.dll lsmash.lib cyglsmash.dll)
80 clean:
81 $(RM) */*.o *.a *.so* *.def *.exp *.lib *.dll *.dylib $(addprefix cli/, *.exe $(TOOLS_ALL)) .depend
83 distclean: clean
84 $(RM) config.* *.pc *.ver
86 dep: .depend
88 depend: .depend
90 ifneq ($(wildcard .depend),)
91 include .depend
92 endif
94 #The dependency of each source file is solved automatically by follows.
95 .depend: config.mak
96 @$(RM) .depend
97 @$(foreach SRC, $(SRC_ALL:%=$(SRCDIR)/%), $(CC) $(SRC) $(CFLAGS) -g0 -MT $(SRC:$(SRCDIR)/%.c=%.o) -MM >> .depend;)
99 liblsmash.pc:
100 ./configure
102 config.h:
103 ./configure
105 config.mak2:
106 ./configure
108 config.mak:
109 ./configure