rockcarry / ffjpeg

a simple jpeg codec.
GNU General Public License v3.0
106 stars 46 forks source link

Makefile #9

Closed zvezdochiot closed 4 years ago

zvezdochiot commented 5 years ago
# makefile for ffjpeg project
# written by rockcarry

CC      = gcc
CCFLAGS = -Wall

OBJS = \
    color.o   \
    dct.o     \
    quant.o   \
    zigzag.o  \
    bitstr.o  \
    huffman.o \
    bmp.o     \
    jfif.o

PROG = ffjpeg
PLIB = $(PROG)

ifeq ($(OS),Windows_NT)
    PROG := $(PROG).exe
    PLIB := $(PLIB).dll
else
    PLIB := lib$(PLIB).so.0
    SOFLAGS = -Wl,-soname,$(PLIB)
endif

all : $(PLIB) $(PROG)

%.o : %.c %.h stdefine.h
    $(CC) $(CCFLAGS) -o $@ $< -c

$(PLIB) : $(OBJS)
    $(CC) -shared $(CCFLAGS) $(SOFLAGS) $^ -o $@ -s

$(PROG) : ffjpeg.c $(PLIB)
    $(CC) $(CCFLAGS) $^ -o $@ -s

clean :
    -rm -f *.o $(PLIB) $(PROG)

# rockcarry
# 2016.1.5
# THE END
SamLiYin commented 5 years ago

Does it work in Mac ?

zvezdochiot commented 5 years ago

I dont know. I don't have a Mac. Only Debian.

rockcarry commented 4 years ago

I improved makefile. now it works on ubuntu, and mingw32.

zvezdochiot commented 4 years ago

https://github.com/rockcarry/ffjpeg/commit/3bd9575857ab3e250738b005b60b762fa85d53c7

Okey.