Skip to content

Instantly share code, notes, and snippets.

@vaiorabbit
Last active December 14, 2015 10:59
Show Gist options
  • Save vaiorabbit/5076143 to your computer and use it in GitHub Desktop.
Save vaiorabbit/5076143 to your computer and use it in GitHub Desktop.
Zopfli (https://code.google.com/p/zopfli/) User API Header and Makefile to build libzopfli.a
# makefile_libzopfli : builds libzopfli.a from library codes.
# Usage :
# $ make -> libzopfli.a
# $ make command -> ./zopfli (test command)
SRCS = \
blocksplitter.c \
cache.c \
deflate.c \
gzip_container.c \
hash.c \
katajainen.c \
lz77.c \
squeeze.c \
tree.c \
util.c \
zlib_container.c
OBJS = $(SRCS:.c=.o)
TARGET = libzopfli.a
.c.o:
gcc -c -O2 -W -Wall -Wextra -ansi -pedantic -o $@ $<
$(TARGET): $(OBJS)
ar rsv $@ $^
clean:
rm $(OBJS) $(TARGET)
command:
gcc -c -O2 -W -Wall -Wextra -ansi -pedantic zopfli.c
gcc -o zopfli zopfli.o -L. -lzopfli
#ifndef ZOPFLI_H_INCLUDED
#define ZOPFLI_H_INCLUDED
#include "util.h"
#include "deflate.h"
#include "gzip_container.h"
#include "zlib_container.h"
#endif /* ZOPFLI_H_INCLUDED */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment