1 # Common Makefile for all ports.
2 # Input: SOURCES - list of C files included in the project
3 # SPECIAL - list of special files that should be included in dependencies
4 # PEEPRULES - list of all peephole rules (.rul) derrived files
5 # PREBUILD - list of special files to build before deps.
7 # Ports are always located in sdcc/src/<portname>
13 # Include the sdcc/src directory
14 INCLUDEFLAGS = -I$(srcdir)/.. -I..
16 # If the sources aren't specified, assume all in this directory.
18 SOURCES = $(notdir $(wildcard $(srcdir)/*.c))
21 # If the peephole rules aren't specified, assume all.
23 PEEPDEFS = $(notdir $(wildcard $(srcdir)/*.def))
24 PEEPRULES = $(PEEPDEFS:.def=.rul)
27 PREBUILD += $(PEEPRULES)
29 all: $(PREBUILD) dep $(LIB)
31 include $(top_builddir)Makefile.common
39 $(AWK) -f $(srcdir)/../SDCCpeeph.awk $< > $@
43 Makefile.dep: $(PREBUILD) Makefile $(SOURCES) $(SPECIAL)
44 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
46 # don't include Makefile.dep for the listed targets:
47 ifeq "$(findstring $(MAKECMDGOALS),clean distclean)" ""
51 include $(srcdir)/../port-clean.mk