# # Common prefix for installation directories. # NOTE: This directory must exist when you start the install. prefix = /usr/local exec_prefix = $(prefix) # Where to put the executable for the command `gcc'. bindir = $(exec_prefix)/bin # Where to put the directories used by the compiler. libexecdir = $(exec_prefix)/libexec # Where to put the Info files. infodir = $(prefix)/info ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) CC = gcc CPP = $(CC) -c ifeq ($(ARCH),"alpha") CFLAGS = -O2 -mcpu=ev4 -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce elifeq ($(ARCH),"i386") CFLAGS = -O2 -m486 -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce else CFLAGS = -O2 -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce endif #DFLAGS = -dm -g #DFLAGS = -dm LIBS = # SRCS = prime.c prime_array.c OBJS = prime.o prime_array.o PROG = prime prime_array all: $(PROG) .depend: $(CPP) -M $(SRCS) > .depend dep: $(CPP) -M $(SRCS) > .depend clean: -rm -f .depend -rm -f *.o -rm -f $(PROG) ifeq (.depend,$(wildcard .depend)) include .depend endif .c.o:; $(CC) $(CFLAGS) $(DFLAGS) -c -o $@ $< .o :; $(CC) $(CFLAGS) $(DFLAGS) -o $@ $< $(LIBS) prime : prime.o prime.o : prime.c prime_array : prime_array.o prime_array.o : prime_array.c