1 export TOPDIR ?= $(CURDIR)/..
2 include $(TOPDIR)/global_config
4 ifneq ($(WANT_LIBZMPEG),no)
7 CFLAGS += -I$(TOPDIR)/libzmpeg3
10 CFLAGS += -DX86_CPU -march=i686 -mcpu=i686 -fomit-frame-pointer
12 $(OBJDIR)/bdist1_mmx.o \
13 $(OBJDIR)/bdist2_mmx.o \
14 $(OBJDIR)/dist2_mmx.o \
15 $(OBJDIR)/fdct_mmx.o \
16 $(OBJDIR)/idct_mmx.o \
17 $(OBJDIR)/mblock_sad_mmx.o \
18 $(OBJDIR)/mblock_sad_mmxe.o \
19 $(OBJDIR)/mblockq_sad_mmxe.o \
20 $(OBJDIR)/predcomp_mmx.o \
21 $(OBJDIR)/predcomp_mmxe.o \
22 $(OBJDIR)/predict_mmx.o \
23 $(OBJDIR)/quant_mmx.o \
26 $(OBJDIR)/mblock_sub44_sads.o \
27 $(OBJDIR)/quantize_x86.o
29 # $(OBJDIR)/mblock_sub44_sads.o \
34 $(OBJDIR)/mpeg2enc.o \
36 $(OBJDIR)/cpu_accel.o \
46 $(OBJDIR)/transfrm.o \
47 $(OBJDIR)/fdctdata.o \
50 $(OBJDIR)/idctdata.o \
51 $(OBJDIR)/quantize.o \
56 LIBS := $(LIBZMPEG3)/$(OBJDIR)/libzmpeg3.a
59 ifeq ($(WANT_CIN_3RDPARTY),no)
62 ifeq ($(shell uname -o), Android)
63 LIBS += ../libbthread-master/jpt.a
66 HVEG2LIB = $(OBJDIR)/hveg2enc.a
67 HVEG2ENC = $(OBJDIR)/hveg2enc
68 HVEG2ENC_G = $(OBJDIR)/hveg2enc_g
70 $(shell mkdir -p $(OBJDIR))
71 $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags)
72 $(shell echo $(HVEG2LIB) $(OBJ) $(NASMOBJ) $(ASMOBJ) > $(OBJDIR)/objs)
74 $(HVEG2ENC): $(OBJDIR)/hveg2enc.o $(HVEG2LIB)
75 $(CXX) `cat $(OBJDIR)/c_flags` -o $@ $^ $(LIBS)
76 $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(HVEG2ENC) $(HVEG2ENC_G))
79 $(OBJDIR)/hveg2enc.o: mpeg2enc.c
80 $(CC) -c `cat $(OBJDIR)/c_flags` -Dmpeg2enc=main -o $@ $^
82 OUTPUT = $(HVEG2LIB) $(HVEG2ENC)
90 cp -a $(HVEG2ENC) $(BINDIR)/.
92 $(HVEG2LIB): $(OBJ) $(NASMOBJ) $(ASMOBJ)
93 ar rcs `cat $(OBJDIR)/objs`
96 nasm -f elf $(subst $(OBJDIR)/,, $*.s) -o $*.o
99 $(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.c) -o $*.o
101 $(OBJDIR)/mpeg2enc.o: mpeg2enc.c
102 $(OBJDIR)/conform.o: conform.c
103 $(OBJDIR)/cpu_accel.o: cpu_accel.c
104 $(OBJDIR)/putseq.o: putseq.c
105 $(OBJDIR)/putpic.o: putpic.c
106 $(OBJDIR)/puthdr.o: puthdr.c
107 $(OBJDIR)/putmpg.o: putmpg.c
108 $(OBJDIR)/putvlc.o: putvlc.c
109 $(OBJDIR)/putbits.o: putbits.c
110 $(OBJDIR)/motion.o: motion.c
111 $(OBJDIR)/predict.o: predict.c
112 $(OBJDIR)/readpic.o: readpic.c
113 $(OBJDIR)/transfrm.o: transfrm.c
114 $(OBJDIR)/fdctdata.o: fdctdata.c
115 $(OBJDIR)/fdctref.o: fdctref.c
116 $(OBJDIR)/idct.o: idct.c
117 $(OBJDIR)/idctdata.o: idctdata.c
118 $(OBJDIR)/quantize.o: quantize.c
119 $(OBJDIR)/ratectl.o: ratectl.c
120 $(OBJDIR)/stats.o: stats.c
121 $(OBJDIR)/writepic.o: writepic.c
124 $(OBJDIR)/bdist1_mmx.o: bdist1_mmx.s
125 $(OBJDIR)/idct_mmx.o: idct_mmx.s
126 $(OBJDIR)/mblockq_sad_mmxe.o: mblockq_sad_mmxe.s
127 $(OBJDIR)/predcomp_mmxe.o: predcomp_mmxe.s
128 $(OBJDIR)/bdist2_mmx.o: bdist2_mmx.s
129 $(OBJDIR)/mblock_sad_mmx.o: mblock_sad_mmx.s
130 $(OBJDIR)/predict_mmx.o: predict_mmx.s
131 $(OBJDIR)/dist2_mmx.o: dist2_mmx.s
132 $(OBJDIR)/mblock_sad_mmxe.o: mblock_sad_mmxe.s
133 $(OBJDIR)/predcomp_mmx.o: predcomp_mmx.s
134 $(OBJDIR)/quant_mmx.o: quant_mmx.s
135 $(OBJDIR)/fdct_mmx.o: fdct_mmx.s
137 #$(OBJDIR)/mblock_sub44_sads.o: mblock_sub44_sads.c
138 $(OBJDIR)/quantize_x86.o: quantize_x86.c
141 @echo $($(subst val-,,$@))