2
0
mirror of https://github.com/vasi/pixz synced 2024-11-05 06:00:12 +00:00
pixz/Makefile

47 lines
850 B
Makefile
Raw Normal View History

2012-12-22 21:10:08 +00:00
VERSION = 1.0
2010-01-17 02:23:23 +00:00
ifneq ($(shell gcc -v 2>&1 | grep 'Apple Inc'),)
APPLE=1
endif
OPT = -g -O0
2012-11-05 06:14:59 +00:00
MYCFLAGS = $(patsubst %,-I%/include,$(LIBPREFIX)) $(OPT) -std=gnu99 \
2012-12-22 21:10:08 +00:00
-Wall -Wno-unknown-pragmas -DPIXZ_VERSION='"$(VERSION)"'
2012-11-05 06:14:59 +00:00
MYLDFLAGS = $(patsubst %,-L%/lib,$(LIBPREFIX)) $(OPT) -Wall
THREADS = -lpthread
LIBADD = $(THREADS) -llzma -larchive
2009-12-20 03:57:39 +00:00
CC = gcc
2012-11-05 06:14:59 +00:00
COMPILE = $(CC) $(MYCFLAGS) $(CFLAGS) -c -o
LD = $(CC) $(MYLDFLAGS) $(LDFLAGS) -o
ifdef APPLE
ifeq ($(CC),gcc)
MYLDFLAGS += -search_paths_first
endif
endif
2009-12-28 05:51:28 +00:00
2010-10-14 05:48:08 +00:00
PROGS = pixz
2012-12-22 21:10:08 +00:00
MANPAGE = pixz.1
2010-10-14 05:48:08 +00:00
COMMON = common.o endian.o cpu.o read.o write.o list.o
2009-12-28 05:51:28 +00:00
2010-01-13 02:30:48 +00:00
all: $(PROGS)
2009-12-28 05:51:28 +00:00
2009-12-29 06:48:51 +00:00
%.o: %.c pixz.h
$(COMPILE) $@ $<
2009-12-28 05:51:28 +00:00
2010-10-13 02:03:45 +00:00
$(PROGS): %: %.o $(COMMON)
$(LD) $@ $^ $(LIBADD)
2010-10-12 06:19:55 +00:00
2009-12-20 03:57:39 +00:00
clean:
2012-12-22 21:10:08 +00:00
rm -f *.o $(PROGS) $(MANPAGE)
$(MANPAGE): pixz.1.asciidoc
a2x -a manversion=$(VERSION) -f manpage $<
dist: $(MANPAGE)
2009-12-20 03:57:39 +00:00
2012-12-22 21:10:08 +00:00
.PHONY: all clean dist