Fetching contributors…
Cannot retrieve contributors at this time
93 lines (67 sloc) 2.01 KB
# Makefile for ttyload
# Copyright 2001 by David Lindes, All Rights Reserved
# see the "LICENSE" file for licensing info.
# change this if you want to use 'make install' and have it go
# somewhere else:
INSTALLDIR = /usr/local/bin
ARCH = `uname -s | sed -e 's/ /-/g'`
LDFLAGS = `./ldflags`
OBJS = arch/${ARCH}/getload.o \
arch/${ARCH}/terminfo.o \
# this is what I use most places...
CC=gcc -pedantic -Wall -Werror
# for the things in the sub-directory:
INCLUDES = -I$${PWD:-.} \
-I$${PWD:-.}/arch/${ARCH} \
# Debugging compiles?
DEBUG = -g
VERSION = -DVERSION='"'`cat Version`'"'
# most people won't want loader, so don't bother building it:
# PROGRAMS = archbuild loader
PROGRAMS = archbuild
default: $(PROGRAMS)
test: $(PROGRAMS)
./ttyload -i 1
# which architechtures are just symlinks?
arch/Darwin \
arch/Isilon-OneFS \
arch/thisarch \
# Some architechtures mimic eachother:
ln -s FreeBSD $@
ln -s ${ARCH} $@
archlinks: $(ARCHLINKS)
archbuild: archlinks
make archtest ttyload ARCH=$(ARCH)
ttyload.c: ttyload.h Version
touch ttyload.c
# have to be explicit here, for some make systems, like .c.o below:
ttyload: $(OBJS) ttyload.o
$(CC) $(LDFLAGS) -o $@ $(OBJS) ttyload.o
archtest: $(OBJS) archtest.o
$(CC) $(LDFLAGS) -o $@ $(OBJS) archtest.o
rm -f *.o $(OBJS) core a.out
clobber: clean
rm -f loader ttyload archtest $(ARCHLINKS)
# install, gently. not much to it:
install: $(PROGRAMS)
/bin/cp ttyload ${INSTALLDIR}/ttyload
# because different systems' make have different behaviors on how they
# deal with building stuff in subdirectories, and because I don't feel
# like descending into the subdirectories to make a single object file,
# I'll force the .c.o rule to what I'm expecting:
$(CC) $(CFLAGS) -o $@ -c $<