* device/lib/pic16/Makefile.common.in: added $(MM) to fix `make clean`
[fw/sdcc] / link / z80 / Makefile.in
1 #
2 #
3 #
4
5 VERSION         = @VERSION@
6 VERSIONHI       = @VERSIONHI@
7 VERSIONLO       = @VERSIONLO@
8 VERSIONP        = @VERSIONP@
9
10 SHELL           = /bin/sh
11 CC              = @CC@
12 CPP             = @CPP@
13 INSTALL         = @INSTALL@
14
15 PRJDIR          = ../..
16
17 EXEEXT          = @EXEEXT@
18
19 srcdir          = @srcdir@
20 prefix          = @prefix@
21 exec_prefix     = @exec_prefix@
22 bindir          = @bindir@
23 libdir          = @libdir@
24 datadir         = @datadir@
25 includedir      = @includedir@
26 mandir          = @mandir@
27 man1dir         = $(mandir)/man1
28 man2dir         = $(mandir)/man2
29 infodir         = @infodir@
30
31 SLIB    =$(PRJDIR)/support/Util
32
33 CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) -I$(PRJDIR)/as/z80 -I$(SLIB)
34 CFLAGS          = @CFLAGS@ -Wall -DINDEXLIB -DMLH_MAP -DUNIX -DSDK -DSDK_VERSION_STRING="\"3.0.0\"" -DTARGET_STRING="\"gbz80\"" -funsigned-char
35 M_OR_MM         = @M_OR_MM@
36 LDFLAGS         = @LDFLAGS@ -lm
37
38 SLIBOBJS        = NewAlloc.o
39
40 LKOBJECTS       = lkarea.o lkdata.o lkeval.o lkhead.o lkihx.o lklex.o \
41                   lklibr.o lklist.o lkmain.o lkrloc.o lks19.o lksym.o \
42                   lkgb.o lkgg.o 
43 LKSOURCES       = $(patsubst %.o,%.c,$(LKOBJECTS))
44
45 LKZ80           = $(PRJDIR)/bin/link-z80$(EXEEXT)
46
47 # Compiling entire program or any subproject
48 # ------------------------------------------
49 all: checkconf $(LKZ80)
50
51 $(LKZ80): $(SLIBOBJS) $(LKOBJECTS)
52         $(CC) $(CFLAGS) -o $@ $(SLIBOBJS) $(LKOBJECTS) $(LDFLAGS)
53
54 # Compiling and installing everything and runing test
55 # ---------------------------------------------------
56 install: all installdirs
57         $(INSTALL) $(LKZ80) $(DESTDIR)$(bindir)/link-z80$(EXEEXT)
58
59 # Deleting all the installed files
60 # --------------------------------
61 uninstall:
62         rm -f $(DESTDIR)$(bindir)/link-z80$(EXEEXT)
63
64
65 # Performing self-test
66 # --------------------
67 check:
68
69
70 # Performing installation test
71 # ----------------------------
72 installcheck:
73
74
75 # Creating installation directories
76 # ---------------------------------
77 installdirs:
78         $(INSTALL) -d $(DESTDIR)$(bindir)
79
80
81 # Creating dependencies
82 # ---------------------
83 dep: Makefile.dep
84
85 Makefile.dep: $(LKSOURCES) *.h $(PRJDIR)/*.h
86         $(CPP) $(CPPFLAGS) $(M_OR_MM) $(LKSOURCES) >Makefile.dep
87
88 include Makefile.dep
89 include clean.mk
90
91 # My rules
92 # --------
93 .c.o:
94         $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
95
96 $(SLIBOBJS):%.o:$(SLIB)/%.c
97         $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
98
99 # Remaking configuration
100 # ----------------------
101 checkconf:
102         @if [ -f $(PRJDIR)/devel ]; then\
103           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
104         fi
105
106 # End of Makefile