115 lines
2.6 KiB
Makefile
115 lines
2.6 KiB
Makefile
#
|
|
#
|
|
#
|
|
|
|
VERSION = @VERSION@
|
|
VERSIONHI = @VERSIONHI@
|
|
VERSIONLO = @VERSIONLO@
|
|
VERSIONP = @VERSIONP@
|
|
|
|
SHELL = /bin/sh
|
|
CC = @CC@
|
|
CPP = @CPP@
|
|
INSTALL = @INSTALL@
|
|
STRIP = @STRIP@
|
|
|
|
PRJDIR = ../..
|
|
|
|
srcdir = @srcdir@
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
bindir = @bindir@
|
|
libdir = @libdir@
|
|
datadir = @datadir@
|
|
includedir = @includedir@
|
|
mandir = @mandir@
|
|
man1dir = $(mandir)/man1
|
|
man2dir = $(mandir)/man2
|
|
infodir = @info@
|
|
|
|
CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR)
|
|
CFLAGS = @CFLAGS@ -Wall
|
|
M_OR_MM = @M_OR_MM@
|
|
LDFLAGS = @LDFLAGS@
|
|
|
|
ASOBJECTS = asmain.o aslex.o assym.o assubr.o asnoice.o \
|
|
asexpr.o asdata.o aslist.o asout.o asstore.o \
|
|
i51ext.o i51pst.o i51mch.o i51adr.o
|
|
ASSOURCES = $(patsubst %.o,%.c,$(ASOBJECTS))
|
|
|
|
LKOBJECTS = lkmain.o lkhead.o lkarea.o lkdata.o \
|
|
lkeval.o lklex.o lksym.o lkrloc.o \
|
|
lklibr.o lklist.o lkihx.o lks19.o \
|
|
lkstore.o lknoice.o
|
|
LKSOURCES = $(patsubst %.o,%.c,$(LKOBJECTS))
|
|
|
|
ASX8051 = $(PRJDIR)/bin/asx8051
|
|
ASLINK = $(PRJDIR)/bin/aslink
|
|
|
|
transform = @program_transform_name@
|
|
|
|
# Compiling entire program or any subproject
|
|
# ------------------------------------------
|
|
all: checkconf $(ASX8051) $(ASLINK)
|
|
|
|
$(ASX8051): $(ASOBJECTS)
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ASOBJECTS)
|
|
|
|
$(ASLINK): $(LKOBJECTS)
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(LKOBJECTS)
|
|
|
|
# Compiling and installing everything and runing test
|
|
# ---------------------------------------------------
|
|
install: all installdirs
|
|
$(INSTALL) $(ASX8051) `echo $(bindir)/asx8051|sed '$(transform)'`
|
|
$(STRIP) `echo $(bindir)/asx8051|sed '$(transform)'`
|
|
$(INSTALL) $(ASLINK) `echo $(bindir)/aslink|sed '$(transform)'`
|
|
$(STRIP) `echo $(bindir)/aslink|sed '$(transform)'`
|
|
|
|
# Deleting all the installed files
|
|
# --------------------------------
|
|
uninstall:
|
|
rm -f $(bindir)/asx8051 $(bindir)/aslink
|
|
|
|
|
|
# Performing self-test
|
|
# --------------------
|
|
check:
|
|
|
|
|
|
# Performing installation test
|
|
# ----------------------------
|
|
installcheck:
|
|
|
|
|
|
# Creating installation directories
|
|
# ---------------------------------
|
|
installdirs:
|
|
$(INSTALL) -d $(bindir)
|
|
|
|
|
|
# Creating dependencies
|
|
# ---------------------
|
|
dep: Makefile.dep
|
|
|
|
Makefile.dep: $(ASSOURCES) $(LKSOURCES) *.h $(PRJDIR)/*.h
|
|
$(CPP) $(CPPFLAGS) $(M_OR_MM) $(ASSOURCES) $(LKSOURCES) >Makefile.dep
|
|
|
|
include Makefile.dep
|
|
include clean.mk
|
|
|
|
# My rules
|
|
# --------
|
|
.c.o:
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
# Remaking configuration
|
|
# ----------------------
|
|
checkconf:
|
|
@if [ -f $(PRJDIR)/devel ]; then\
|
|
$(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
|
|
fi
|
|
|
|
# End of Makefile
|