blob: be17ff7c537cd30edf2f5cf41eea4478567a8921 [file] [log] [blame]
TARGET = radix
OBJS = radix.o
CFLAGS := $(CFLAGS) -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wdisabled-optimization
CFLAGS := $(CFLAGS) -Wpadded -Winline -Wpointer-arith -Wsign-compare -Wendif-labels
LDFLAGS := $(LDFLAGS) -lm
PREFIX=${PARSECDIR}/ext/splash2x/kernels/radix/inst/${PARSECPLAT}
MACROS := ${PARSECDIR}/pkgs/libs/parmacs/inst/${PARSECPLAT}/m4/parmacs.${PARMACS_MACRO_FILE}.c.m4
ifdef version
ifeq "$(version)" "pthreads"
CFLAGS := $(CFLAGS) -DENABLE_THREADS -pthread
endif
endif
.PHONY: install clean
$(TARGET): $(OBJS)
$(CC) $(OBJS) $(CFLAGS) -o $(TARGET) $(LDFLAGS) $(LIBS)
install:
mkdir -p $(PREFIX)/bin
cp -f $(TARGET) $(PREFIX)/bin/$(TARGET)
cp -f run.sh $(PREFIX)/bin/run.sh
clean:
rm -rf *.c *.h *.o $(TARGET)
.SUFFIXES:
.SUFFIXES: .o .c .C .h .H
.H.h:
$(M4) -s -Ulen -Uindex $(MACROS) $*.H > $*.h
.C.c:
$(M4) -s -Ulen -Uindex $(MACROS) $*.C > $*.c
.c.o:
$(CC) -c $(CFLAGS) $*.c
.C.o:
$(M4) -s -Ulen -Uindex $(MACROS) $*.C > $*.c
$(CC) -c $(CFLAGS) $*.c