2001-08-21 21:53:19 +02:00
|
|
|
# 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
|
|
|
|
|
2005-07-31 00:52:46 +02:00
|
|
|
ARCH = `uname -s | sed -e 's/ /-/g'`
|
2001-08-24 22:56:47 +02:00
|
|
|
LDFLAGS = `./ldflags`
|
2000-05-20 03:31:30 +02:00
|
|
|
|
2001-08-28 03:00:31 +02:00
|
|
|
OBJS = arch/${ARCH}/getload.o \
|
|
|
|
arch/${ARCH}/terminfo.o \
|
2005-07-31 00:32:19 +02:00
|
|
|
${NULL}
|
2000-05-20 03:31:30 +02:00
|
|
|
|
2000-05-20 03:46:27 +02:00
|
|
|
# this is what I use most places...
|
2010-03-05 01:38:38 +01:00
|
|
|
CC=gcc -pedantic -Wall -Werror
|
2000-05-20 03:46:27 +02:00
|
|
|
|
2000-05-20 03:31:30 +02:00
|
|
|
# for the things in the sub-directory:
|
2001-08-21 21:53:19 +02:00
|
|
|
INCLUDES = -I$${PWD:-.} \
|
|
|
|
-I$${PWD:-.}/arch/${ARCH} \
|
|
|
|
-I$${PWD:-.}/arch/default
|
2000-05-20 03:31:30 +02:00
|
|
|
|
2000-05-20 03:46:27 +02:00
|
|
|
# Debugging compiles?
|
|
|
|
DEBUG = -g
|
|
|
|
|
2001-02-24 10:15:42 +01:00
|
|
|
VERSION = -DVERSION='"'`cat Version`'"'
|
2000-05-20 03:31:30 +02:00
|
|
|
|
2001-02-24 10:15:42 +01:00
|
|
|
CFLAGS = $(INCLUDES) $(OTHER_FLAGS) $(DEBUG) $(VERSION)
|
|
|
|
|
2001-08-23 02:50:03 +02:00
|
|
|
# most people won't want loader, so don't bother building it:
|
|
|
|
# PROGRAMS = archbuild loader
|
|
|
|
PROGRAMS = archbuild
|
2001-08-21 21:53:19 +02:00
|
|
|
|
|
|
|
default: $(PROGRAMS)
|
2001-02-24 10:15:42 +01:00
|
|
|
|
2005-07-31 00:26:11 +02:00
|
|
|
test: $(PROGRAMS)
|
2001-02-24 11:56:15 +01:00
|
|
|
./ttyload -i 1
|
2001-02-24 10:15:42 +01:00
|
|
|
|
2005-07-31 00:26:11 +02:00
|
|
|
# which architechtures are just symlinks?
|
2005-07-31 00:52:46 +02:00
|
|
|
ARCHLINKS_FREEBSD = \
|
|
|
|
arch/Darwin \
|
|
|
|
arch/Isilon-OneFS \
|
|
|
|
${NULL}
|
|
|
|
|
2005-09-09 21:52:11 +02:00
|
|
|
ARCHLINKS_THISARCH = \
|
|
|
|
arch/thisarch \
|
|
|
|
${NULL}
|
|
|
|
|
2005-07-31 00:52:46 +02:00
|
|
|
ARCHLINKS = \
|
|
|
|
$(ARCHLINKS_FREEBSD) \
|
2005-09-09 21:52:11 +02:00
|
|
|
$(ARCHLINKS_THISARCH) \
|
2005-07-31 00:26:11 +02:00
|
|
|
${NULL}
|
|
|
|
|
|
|
|
# Some architechtures mimic eachother:
|
2005-07-31 00:52:46 +02:00
|
|
|
$(ARCHLINKS_FREEBSD):
|
|
|
|
ln -s FreeBSD $@
|
|
|
|
|
2005-09-09 21:52:11 +02:00
|
|
|
$(ARCHLINKS_THISARCH):
|
|
|
|
ln -s ${ARCH} $@
|
|
|
|
|
2005-07-31 00:52:46 +02:00
|
|
|
archlinks: $(ARCHLINKS)
|
2005-07-31 00:26:11 +02:00
|
|
|
|
|
|
|
archbuild: archlinks
|
2005-07-31 00:52:46 +02:00
|
|
|
make archtest ttyload ARCH=$(ARCH)
|
2000-05-20 03:31:30 +02:00
|
|
|
|
2001-02-24 10:15:42 +01:00
|
|
|
ttyload.c: ttyload.h Version
|
|
|
|
touch ttyload.c
|
2000-05-20 03:31:30 +02:00
|
|
|
|
2001-08-24 05:52:47 +02:00
|
|
|
# have to be explicit here, for some make systems, like .c.o below:
|
2000-05-20 03:31:30 +02:00
|
|
|
ttyload: $(OBJS) ttyload.o
|
2001-08-24 22:56:47 +02:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $(OBJS) ttyload.o
|
2000-05-20 03:31:30 +02:00
|
|
|
|
2001-08-28 03:00:31 +02:00
|
|
|
archtest: $(OBJS) archtest.o
|
|
|
|
$(CC) $(LDFLAGS) -o $@ $(OBJS) archtest.o
|
|
|
|
|
2000-05-20 03:31:30 +02:00
|
|
|
clean:
|
2001-08-24 09:24:43 +02:00
|
|
|
rm -f *.o $(OBJS) core a.out
|
2001-08-21 21:53:19 +02:00
|
|
|
|
|
|
|
clobber: clean
|
2005-07-31 00:26:11 +02:00
|
|
|
rm -f loader ttyload archtest $(ARCHLINKS)
|
2001-08-21 21:53:19 +02:00
|
|
|
|
|
|
|
# install, gently. not much to it:
|
2005-07-31 00:26:11 +02:00
|
|
|
install: $(PROGRAMS)
|
2001-08-24 23:15:25 +02:00
|
|
|
/bin/cp ttyload ${INSTALLDIR}/ttyload
|
2001-08-24 05:52:47 +02:00
|
|
|
|
|
|
|
# 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:
|
|
|
|
.c.o:
|
|
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|