6 VERSIONHI = @VERSIONHI@
7 VERSIONLO = @VERSIONLO@
16 INCDIR = $(PRJDIR)/device/include
18 CC = $(PRJDIR)/bin/sdcc
19 CPP = $(PRJDIR)/bin/sdcpp
22 exec_prefix = @exec_prefix@
26 includedir = @includedir@
28 man1dir = $(mandir)/man1
29 man2dir = $(mandir)/man2
33 CPPFLAGS = -I$(INCDIR)
36 OBJECTS = _atoi.rel _atol.rel _autobaud.rel _bp.rel _char2fs.rel \
37 _decdptr.rel _divsint.rel _divslong.rel _divuint.rel \
38 _divulong.rel _fs2char.rel _fs2int.rel _fs2long.rel \
39 _fs2uchar.rel _fs2uint.rel _fs2ulong.rel _fsadd.rel \
40 _fsdiv.rel _fseq.rel _fsgt.rel _fslt.rel _fsmul.rel \
41 _fsneq.rel _fssub.rel _gptrget.rel _gptrput.rel \
42 _int2fs.rel _iscntrl.rel _isdigit.rel _isgraph.rel \
43 _islower.rel _isprint.rel _ispunct.rel _isspace.rel \
44 _isupper.rel _isxdigit.rel _long2fs.rel _memcmp.rel \
45 _memcpy.rel _memset.rel _modsint.rel _modslong.rel \
46 _moduint.rel _modulong.rel _mulsint.rel _muluint.rel \
47 _mululong.rel _muslong.rel _ser.rel _setjmp.rel \
48 _spx.rel _startup.rel _strchr.rel _strcmp.rel _strcpy.rel \
49 _strcspn.rel _strlen.rel _strncat.rel _strncmp.rel \
50 _strncpy.rel _strpbrk.rel _strrchr.rel _strspn.rel \
51 _strstr.rel _strtok.rel _uchar2fs.rel _uint2fs.rel \
52 _ulong2fs.rel malloc.rel serial.rel ser_ir.rel printfl.rel \
53 printf_large.rel vprintf.rel puts.rel assert.rel _strcat.rel
54 SOURCES = $(patsubst %.rel,%.c,$(OBJECTS))
58 # Compiling entire program or any subproject
59 # ------------------------------------------
65 for model in $(MODELS); do \
66 test -d $$model || mkdir $$model; \
67 $(MAKE) CFLAGS="$(CFLAGS) --model-$$model" objects; \
73 # Compiling and installing everything and runing test
74 # ---------------------------------------------------
76 $(CP) *.c $(datadir)/lib/
77 for model in $(MODELS); do \
78 [ -d $$model ] || $(MAKE) all; \
79 $(CP) $$model/*.rel *.lib $(datadir)/lib/$$model/; \
80 $(CP) $$model/*.asm $(datadir)/lib/$$model/; \
81 $(CP) $$model/*.cdb $(datadir)/lib/$$model/; \
85 # Deleting all the installed files
86 # --------------------------------
88 for hdr in *.h; do rm -f $(datadir)/$$hdr; done
89 for model i $(MODELS); do \
90 rm -rf $(datadir)/lib/$$model; \
94 # Performing self-test
95 # --------------------
99 # Performing installation test
100 # ----------------------------
104 # Creating installation directories
105 # ---------------------------------
107 [ -d $(datadir)/lib ] || mkdir -p $(datadir)/lib
108 for model in $(MODELS); do \
109 [ -d $(datadir)/lib/$$model ] || \
110 mkdir -p $(datadir)/lib/$$model; \
114 # Creating dependencies
115 # ---------------------
118 Makefile.dep: $(SOURCES) $(INCDIR)/*.h
119 for i in $(SOURCES); do \
120 $(CPP) -M $(CPPFLAGS) $$i >$${i}.dep; \
121 cat $${i}.dep >>Makefile.dep; \
134 $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
137 # Remaking configuration
138 # ----------------------
140 @if [ -f $(PRJDIR)/devel ]; then\
141 $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
145 # End of main_in.mk/main.mk