# Installation directories: INSTALLDIR = INSTALLDIR_IS_UNDEFINED INC = $(INSTALLDIR)/include LIB = $(INSTALLDIR)/lib BIN = $(INSTALLDIR)/$(PLATFORM)/bin MAN = $(INSTALLDIR)/$(PLATFORM)/man/man1 HFILES = HOFILES = OFILES = PROG = \ dusort MANPAGE = \ $(PROG).1 MAINOBJ = \ $(PROG).o LIBS = INCLUDES = GCCFLAGS = \ $(INCLUDES) \ -g \ -ansi \ -Wall -Wtraditional -Wpointer-arith -Wmissing-prototypes \ -mfpu .PHONY: all cleanup uninstall install all: uninstall $(PROG) install cleanup: ;\ rm -f $(HOFILES) $(OFILES) $(MAINOBJ) $(PROG) uninstall: ;\ ( cd $(BIN) && rm -f $(PROG) ); \ ( cd $(MAN) && rm -f $(MANPAGE) ) %.o: %.c ;\ gcc -c $(GCCFLAGS) $*.c %.ho: %.h ;\ gcc -o $*.ho -c $(GCCFLAGS) -x c $*.h \ || /bin/rm -f $*.ho $(PROG): $(OFILES) $(MAINOBJ) $(LIBS) ;\ gcc -o $(PROG) $(MAINOBJ) $(OFILES) $(LIBS) -lm install: ;\ cp -p $(PROG) $(BIN) ;\ cp -p $(MANPAGE) $(MAN) check: @echo "BIN=$(BIN)" @echo "MAN=$(MAN)" # Dependencies of .h files: # Dependencies for .c files: dusort.o:: dusort.c