2
0
mirror of https://github.com/vasi/pixz synced 2024-10-30 15:21:41 +00:00
pixz/Makefile

37 lines
647 B
Makefile
Raw Normal View History

2010-01-17 02:23:23 +00:00
ifneq ($(shell gcc -v 2>&1 | grep 'Apple Inc'),)
APPLE=1
endif
ifdef APPLE
ifeq ($(CC),gcc)
2010-01-17 02:23:23 +00:00
LDFLAGS += -search_paths_first
endif
endif
OPT = -g -O0
CFLAGS = $(patsubst %,-I%/include,$(LIBPREFIX)) $(OPT) -std=gnu99 \
2010-10-11 03:39:21 +00:00
-Wall -Wno-unknown-pragmas
LDFLAGS = $(patsubst %,-L%/lib,$(LIBPREFIX)) $(OPT) -Wall
THREADS = -lpthread
LIBADD = $(THREADS) -llzma -larchive
2009-12-20 03:57:39 +00:00
CC = gcc
COMPILE = $(CC) $(CFLAGS) -c -o
LD = $(CC) $(LDFLAGS) -o
2009-12-28 05:51:28 +00:00
2010-10-14 05:48:08 +00:00
PROGS = pixz
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:
2010-01-13 02:30:48 +00:00
rm -f *.o $(PROGS)
2009-12-20 03:57:39 +00:00
2010-01-13 02:30:48 +00:00
.PHONY: all clean