2010-01-17 02:23:23 +00:00
|
|
|
ifneq ($(shell gcc -v 2>&1 | grep 'Apple Inc'),)
|
|
|
|
APPLE=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef APPLE
|
2010-10-11 03:37:50 +00:00
|
|
|
ifeq ($(CC),gcc)
|
2010-01-17 02:23:23 +00:00
|
|
|
LDFLAGS += -search_paths_first
|
|
|
|
endif
|
2010-10-11 03:37:50 +00:00
|
|
|
endif
|
2010-10-13 03:44:29 +00:00
|
|
|
OPT = -g -O0
|
2011-05-17 19:04:15 +00:00
|
|
|
CFLAGS = $(patsubst %,-I%/include,$(LIBPREFIX)) $(OPT) -std=gnu99 \
|
2010-10-11 03:39:21 +00:00
|
|
|
-Wall -Wno-unknown-pragmas
|
2012-09-18 07:10:03 +00:00
|
|
|
LDFLAGS = $(patsubst %,-L%/lib,$(LIBPREFIX)) $(OPT) -Wall
|
|
|
|
|
|
|
|
THREADS = -lpthread
|
|
|
|
LIBADD = $(THREADS) -llzma -larchive
|
2009-12-20 03:57:39 +00:00
|
|
|
|
2010-10-11 03:37:50 +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
|
2010-10-11 03:37:50 +00:00
|
|
|
$(COMPILE) $@ $<
|
2009-12-28 05:51:28 +00:00
|
|
|
|
2010-10-13 02:03:45 +00:00
|
|
|
$(PROGS): %: %.o $(COMMON)
|
2012-09-18 07:10:03 +00:00
|
|
|
$(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
|