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