diff --git a/Makefile b/Makefile index 4901162..c09e45a 100644 --- a/Makefile +++ b/Makefile @@ -2,22 +2,23 @@ ifneq ($(shell gcc -v 2>&1 | grep 'Apple Inc'),) APPLE=1 endif -ifdef APPLE -ifeq ($(CC),gcc) - LDFLAGS += -search_paths_first -endif -endif OPT = -g -O0 -CFLAGS = $(patsubst %,-I%/include,$(LIBPREFIX)) $(OPT) -std=gnu99 \ +MYCFLAGS = $(patsubst %,-I%/include,$(LIBPREFIX)) $(OPT) -std=gnu99 \ -Wall -Wno-unknown-pragmas -LDFLAGS = $(patsubst %,-L%/lib,$(LIBPREFIX)) $(OPT) -Wall +MYLDFLAGS = $(patsubst %,-L%/lib,$(LIBPREFIX)) $(OPT) -Wall THREADS = -lpthread LIBADD = $(THREADS) -llzma -larchive CC = gcc -COMPILE = $(CC) $(CFLAGS) -c -o -LD = $(CC) $(LDFLAGS) -o +COMPILE = $(CC) $(MYCFLAGS) $(CFLAGS) -c -o +LD = $(CC) $(MYLDFLAGS) $(LDFLAGS) -o + +ifdef APPLE +ifeq ($(CC),gcc) + MYLDFLAGS += -search_paths_first +endif +endif PROGS = pixz COMMON = common.o endian.o cpu.o read.o write.o list.o diff --git a/pixz.h b/pixz.h index b7c7d61..df9a398 100644 --- a/pixz.h +++ b/pixz.h @@ -20,7 +20,9 @@ #define CHUNKSIZE 4096 -#define DEBUG 0 +#ifndef DEBUG + #define DEBUG 0 +#endif #if DEBUG #define debug(str, ...) fprintf(stderr, str "\n", ##__VA_ARGS__) #else