blob: 896ec3a8833c4520f186d6bb6a188290e6ffe274 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
--- ./Makefile.orig 2011-02-14 08:49:25.000000000 +0100
+++ ./Makefile 2011-04-05 18:39:35.000000000 +0200
@@ -4,21 +4,18 @@
# change this if you want to use 'make install' and have it go
# somewhere else:
-INSTALLDIR = /usr/local/bin
+PREFIX?= /usr/local
-ARCH = `uname -s | sed -e 's/ /-/g'`
+OS = `uname -s | sed -e 's/ /-/g'`
LDFLAGS = `./ldflags`
-OBJS = arch/${ARCH}/getload.o \
- arch/${ARCH}/terminfo.o \
+OBJS = arch/${OS}/getload.o \
+ arch/${OS}/terminfo.o \
${NULL}
-# 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} \
+ -I$${PWD:-.}/arch/${OS} \
-I$${PWD:-.}/arch/default
# Debugging compiles?
@@ -26,7 +23,7 @@
VERSION = -DVERSION='"'`cat Version`'"'
-CFLAGS = $(INCLUDES) $(OTHER_FLAGS) $(DEBUG) $(VERSION)
+CFLAGS = $(INCLUDES) $(OTHER_FLAGS) $(DEBUG) $(VERSION) -pedantic -Wall
# most people won't want loader, so don't bother building it:
# PROGRAMS = archbuild loader
@@ -57,12 +54,12 @@
ln -s FreeBSD $@
$(ARCHLINKS_THISARCH):
- ln -s ${ARCH} $@
+ ln -s ${OS} $@
archlinks: $(ARCHLINKS)
archbuild: archlinks
- make archtest ttyload ARCH=$(ARCH)
+ make archtest ttyload OS=$(OS)
ttyload.c: ttyload.h Version
touch ttyload.c
@@ -82,7 +79,11 @@
# install, gently. not much to it:
install: $(PROGRAMS)
- /bin/cp ttyload ${INSTALLDIR}/ttyload
+ install -m 755 ttyload ${PREFIX}/bin/
+
+deinstall:
+ rm -f ${PREFIX}/bin/ttyload
+
# because different systems' make have different behaviors on how they
# deal with building stuff in subdirectories, and because I don't feel
|