-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile.def
52 lines (44 loc) · 1.75 KB
/
Makefile.def
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
# Macroassembler AS Makefile.def for asl-releases `upstream` branch.
# This attempts to extract the version from the source and use that
# for the install directory, /opt/asl-$VER.
# -------------------------------------------------------------------------
# choose your compiler (must be ANSI-compliant!) and linker command, plus
# any additionally needed flags
OBJDIR =
CC = gcc
CFLAGS = -g -O3 -march=athlon64 -fomit-frame-pointer -Wall
HOST_OBJEXTENSION = .o
LD = $(CC)
LDFLAGS =
HOST_EXEXTENSION =
# no cross build
TARG_OBJDIR = $(OBJDIR)
TARG_CC = $(CC)
TARG_CFLAGS = $(CFLAGS)
TARG_OBJEXTENSION = $(HOST_OBJEXTENSION)
TARG_LD = $(LD)
TARG_LDFLAGS = $(LDFLAGS)
TARG_EXEXTENSION = $(HOST_EXEXTENSION)
# -------------------------------------------------------------------------
# directories where binaries, includes, and manpages should go during
# installation
# Versions ≤ 1.42bld254 define a *DebVersion string in version.c from
# which we can extract the version number. If we don't find this, we
# instead extract the build number from AS_VERSION{MAJOR,MINOR,BUILD}
# in version.h, where it moved from bld255 onwards. Use `make paths`
# (target below) to show the extracted version number and install path.
VER != sed -n \
-e 's/1.42//' -e 's/";.*//' -e 's/-[0-9]$$//' -e 's/.*DebVersion = "//p' \
version.c
VER := $(or $(VER),\
bld$(shell sed -n -e 's/^\#define AS_VERSION_BUILD //p' version.h))
VER := $(or $(VER),$(error Cannot extract ASL version number.))
__INSTDIR=/opt/asl-${VER}
BINDIR = ${__INSTDIR}/bin
INCDIR = ${__INSTDIR}/include/asl
MANDIR = ${__INSTDIR}/man
LIBDIR = ${__INSTDIR}/lib/asl
DOCDIR = ${__INSTDIR}/doc/asl
paths: # Display the extracted version number and install path
@echo VER=${VER}
@echo BINDIR=${BINDIR}