X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=as%2Fz80%2FMakefile.in;h=f67d462880aef7789141ba1843a08098a21af2a6;hb=662402712689eba7ab2689fa8030a533e08897aa;hp=a89dd13af16ebc32555b3ea9195412ca45fca456;hpb=2d68a8dff5ebde9772c9f8467064324d8d408e8d;p=fw%2Fsdcc diff --git a/as/z80/Makefile.in b/as/z80/Makefile.in index a89dd13a..f67d4628 100644 --- a/as/z80/Makefile.in +++ b/as/z80/Makefile.in @@ -1,97 +1,69 @@ -# -# -# +VPATH = @srcdir@ +srcdir = @srcdir@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ -VERSION = @VERSION@ -VERSIONHI = @VERSIONHI@ -VERSIONLO = @VERSIONLO@ -VERSIONP = @VERSIONP@ +include $(top_builddir)/Makefile.common -SHELL = /bin/sh -CC = @CC@ -CPP = @CPP@ -INSTALL = @INSTALL@ +OBJDIR = obj/$(EXT) -PRJDIR = ../.. +ASXXLIB = $(srcdir)/../asxxsrc -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@ +ASXXLIBSRC = strcmpi.c assym.c -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 +SRC = asdata.c asexpr.c aslex.c aslist.c asmain.c asout.c \ + assubr.c z80adr.c z80ext.c z80mch.c z80pst.c -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)) +ASSOURCES = $(SRC) $(ASXXLIBSRC:%.c=$(ASXXLIB)/%.c) -ASXZ80 = $(PRJDIR)/bin/as-z80 +ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o) -# Compiling entire program or any subproject -# ------------------------------------------ -all: checkconf $(ASXZ80) +OBJS = $(SRC:%.c=$(OBJDIR)/%.o) -$(ASXZ80): $(ASOBJECTS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(ASOBJECTS) +ASOBJECTS = $(OBJS) $(ASXXLIBOBJS) -# Compiling and installing everything and runing test -# --------------------------------------------------- -install: all installdirs - $(INSTALL) $(ASXZ80) $(bindir)/as-z80 +BINS = $(BUILDDIR)/as$(EXT)$(EXEEXT) -# Deleting all the installed files -# -------------------------------- -uninstall: - rm -f $(bindir)/as-z80 +CFLAGS += $(CPPFLAGS) $(OPTS) -I. -DINDEXLIB -DMLH_MAP -DUNIX -DSDK +CFLAGS += -funsigned-char +LDFLAGS = @LDFLAGS@ -lm $(EXTRALIBS) -# Performing self-test -# -------------------- -check: +all: dep $(BINS) +dep: Makefile.dep -# Performing installation test -# ---------------------------- -installcheck: - +Makefile.dep: $(ASSOURCES) $(srcdir)/*.h + $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) > Makefile.dep -# Creating installation directories -# --------------------------------- -installdirs: - $(INSTALL) -d $(bindir) +ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs \ + clean distclean mostlyclean realclean)" "" + -include Makefile.dep +endif +# We need a '.stamp'-file in $(OBJDIR), because the time stamp +# of $(OBJDIR) itself is always updated, when a file in $(OBJDIR) +# is updated. A rule like +# $(OBJDIR)/anyfile: $(OBJDIR) +# will always force a remake (at least on Linux ext2). -# Creating dependencies -# --------------------- -dep: Makefile.dep +$(OBJDIR)/.stamp: + mkdir -p $(OBJDIR) + touch $(OBJDIR)/.stamp -Makefile.dep: $(ASSOURCES) *.h $(PRJDIR)/*.h - $(CPP) $(CPPFLAGS) $(M_OR_MM) $(ASSOURCES) >Makefile.dep +$(BINS): $(ASOBJECTS) + $(CC) -o $(BINS) $(ASOBJECTS) $(LDFLAGS) -include Makefile.dep -include clean.mk +$(OBJDIR)/%.o: %.c $(OBJDIR)/.stamp + $(CC) -c $(CFLAGS) -o $@ $< -# My rules -# -------- -.c.o: - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< +$(OBJDIR)/%.o: $(ASXXLIB)/%.c $(OBJDIR)/.stamp + $(CC) -c $(CFLAGS) -o $@ $< +_as-z80: + $(MAKE) EXT=-z80$(E) -# Remaking configuration -# ---------------------- -checkconf: - @if [ -f $(PRJDIR)/devel ]; then\ - $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\ - fi +_as-gbz80: + $(MAKE) EXT=-gbz80$(E) OPTS=-DGAMEBOY -# End of Makefile +include $(srcdir)/clean.mk