98 lines
2 KiB
Makefile
98 lines
2 KiB
Makefile
#
|
|
#
|
|
#
|
|
|
|
VERSION = @VERSION@
|
|
VERSIONHI = @VERSIONHI@
|
|
VERSIONLO = @VERSIONLO@
|
|
VERSIONP = @VERSIONP@
|
|
|
|
SHELL = /bin/sh
|
|
CC = @CC@
|
|
CPP = @CPP@
|
|
INSTALL = @INSTALL@
|
|
|
|
PRJDIR = ../..
|
|
|
|
srcdir = @srcdir@
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
bindir = @bindir@
|
|
libdir = @libdir@
|
|
datadir = @datadir@
|
|
includedir = @include@
|
|
mandir = @mandir@
|
|
man1dir = $(mandir)/man1
|
|
man2dir = $(mandir)/man2
|
|
infodir = @infodir@
|
|
|
|
CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR)
|
|
CFLAGS = @CFLAGS@ -Wall -DINDEXLIB -DMLH_MAP -DUNIX -DSDK -funsigned-char -ggdb
|
|
M_OR_MM = @M_OR_MM@
|
|
LDFLAGS = @LDFLAGS@ -lm
|
|
|
|
ASOBJECTS = asdata.o asexpr.o aslex.o aslist.o asmain.o asout.o \
|
|
assubr.o assym.o z80adr.o z80ext.o z80mch.o z80pst.o
|
|
ASSOURCES = $(patsubst %.o,%.c,$(ASOBJECTS))
|
|
|
|
ASXZ80 = $(PRJDIR)/bin/as-z80
|
|
|
|
# Compiling entire program or any subproject
|
|
# ------------------------------------------
|
|
all: checkconf $(ASXZ80)
|
|
|
|
$(ASXZ80): $(ASOBJECTS)
|
|
$(CC) $(CFLAGS) -o $@ $(ASOBJECTS) $(LDFLAGS)
|
|
|
|
# Compiling and installing everything and runing test
|
|
# ---------------------------------------------------
|
|
install: all installdirs
|
|
$(INSTALL) $(ASXZ80) $(bindir)/as-z80
|
|
|
|
# Deleting all the installed files
|
|
# --------------------------------
|
|
uninstall:
|
|
rm -f $(bindir)/as-z80
|
|
|
|
|
|
# Performing self-test
|
|
# --------------------
|
|
check:
|
|
|
|
|
|
# Performing installation test
|
|
# ----------------------------
|
|
installcheck:
|
|
|
|
|
|
# Creating installation directories
|
|
# ---------------------------------
|
|
installdirs:
|
|
$(INSTALL) -d $(bindir)
|
|
|
|
|
|
# Creating dependencies
|
|
# ---------------------
|
|
dep: Makefile.dep
|
|
|
|
Makefile.dep: $(ASSOURCES) *.h $(PRJDIR)/*.h
|
|
$(CPP) $(CPPFLAGS) $(M_OR_MM) $(ASSOURCES) >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
|