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>
11 # Include the sdcc/src directory
14 # If the sources aren't specified, assume all in this directory.
16 SOURCES = $(wildcard *.c)
19 # If the peephole rules aren't specified, assume all.
21 PEEPDEFS = $(wildcard *.def)
22 PEEPRULES = $(PEEPDEFS:.def=.rul)
25 PREBUILD += $(PEEPRULES)
27 all: $(PREBUILD) dep $(LIB)
29 include $(PRJDIR)/Makefile.common
37 $(AWK) -f ../SDCCpeeph.awk $< > $@
41 Makefile.dep: $(PREBUILD) Makefile $(SOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h $(PRJDIR)/src/*.h
42 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
46 include ../port-clean.mk