-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.mk
More file actions
executable file
·656 lines (494 loc) · 14.9 KB
/
rules.mk
File metadata and controls
executable file
·656 lines (494 loc) · 14.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# rules.mk
#
# Правила компиляции, цели
#
# GOALS:
# clean - clean working dirs
# flash - files for programm flash
# eeprom - files for programm eeprom (if exist)
# lst - listing
# elf - .elf file
# tag - tags, cscope.out
#
# fhex - Intel .hex for flash
# ehex - Intel .hex for eeprom
# fsrec - Motorola .srec for flash
# esrec - Motorola .srec for eeprom
# fbin - .bin for flash
# ebin - .bin for eeprom
#
# hex, bin, srec
#
all: clean flash eeprom lst
flash: fhex fbin fsrec
eeprom: ehex ebin esrec
CFLAGS += -fno-common
CFLAGS += -fshort-enums -Wswitch -funsigned-char
CFLAGS += -funsigned-bitfields
CFLAGS += -finline-functions-called-once
CFLAGS += -foptimize-sibling-calls
CFLAGS += -ffunction-sections
CFLAGS += -fzero-initialized-in-bss
CFLAGS += -Wdiv-by-zero -Wempty-body -Wfloat-equal
CFLAGS += -Wignored-qualifiers
CFLAGS += -Wimplicit-function-declaration -Wimplicit-int -Wmissing-braces
CFLAGS += -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes
CFLAGS += -Wmultichar -Wnonnull -Wparentheses -Wreturn-type
CFLAGS += -Wsequence-point -Wsign-compare -Wsign-conversion
CFLAGS += -Wstrict-prototypes -Wtype-limits
CFLAGS += -Woverflow -Wuninitialized
LDFLAGS += -Wl,--gc-section,--reduce-memory-overheads,--relax
$(foreach lang,$(LANGS), \
$(foreach id,$($(lang)_INCLUDE_DIRS), \
$(eval $(lang)FLAGS += -I $(id))))
$(foreach lang,$(LANGS), \
$(foreach id,$(INCLUDE_DIRS), \
$(eval $(lang)FLAGS += -I $(id))))
$(foreach id,$(LD_INCLUDE_DIRS), $(eval LDFLAGS += -Wl,-L$(id)))
.PHONY: all clean flash eeprom lst elf tag
.PHONY: fhex ehex fsrec esrec fbin ebin
.PHONY: hex bin srec flash eeprom
ifndef OBJDIR
OBJDIR := obj/
else
OBJDIR := $(OBJDIR:%/=%)/
endif
PROGDIR := $(OBJDIR)
AVR_MCUs := \
atmega16 \
atmega64 \
atxmega64a1 \
atxmega64a3 \
ARM_MCUs := \
STM32F429xx \
CMP ?= cmp
CP ?= cp
MKDIR ?= mkdir -p
MV ?= mv
RM ?= rm
SED ?= sed
HEAD ?= head
HOST_CC ?= gcc
CTAGS ?= ctags
CSCOPE ?= cscope
ECHO ?= echo
# определяем насколько будем подниматься до самого верхнего из обрабатываемых
# каталогов (если такие есть) и на соответствующую глубину опускаем каталог
# с объектными файлами
$(foreach lang,$(LANGS), $(eval ALL_SRCS := $(ALL_SRCS) $($(lang)_SRC)) )
MK_DIRS :=
MAX_DOWNDIRS :=
DOWNDIRS :=
# del_updir src_file, updirs
define del_updir
$(eval DOWNDIRS := u/$(2))
$(eval $(if $(findstring $(DOWNDIRS),$(MAX_DOWNDIRS)),, \
$(eval MAX_DOWNDIRS := $(DOWNDIRS)) ))
$(eval $(call proc_name,$(patsubst ../%,%,$(1)),$(DOWNDIRS)))
endef
# proc_name src_file, updirs
define proc_name
$(eval $(if $(subst 1,,$(patsubst ../%,1,$(1))),, \
$(eval $(call del_updir,$(1),$(2))) \
))
endef
$(eval $(foreach name, $(ALL_SRCS), $(eval MK_DIRS += $(dir $(name)))))
MK_DIRS := $(sort $(MK_DIRS))
$(foreach name,$(MK_DIRS), $(eval $(call proc_name,$(name),)) )
OBJDIR := $(OBJDIR)$(MAX_DOWNDIRS)
MK_DIRS := $(MK_DIRS:%=$(OBJDIR)%)
LD_FLAGS := $(LDFLAGS) -Wl,-Map,$(PROGDIR)$(PRG).map
C_FLAGS := $(CFLAGS) $(OPTIMIZE) $(REGS)
C_OBJS := $(C_SRC:%.c=$(OBJDIR)%.o)
C_DEPS := $(C_OBJS:%=%.d)
CPP_FLAGS := $(CPPFLAGS) $(OPTIMIZE) $(REGS)
CPP_OBJS := $(CPP_SRC:%.cpp=$(OBJDIR)%.o)
CPP_DEPS := $(CPP_OBJS:%=%.d)
AS_FLAGS := $(ASFLAGS) $(OPTIMIZE) $(REGS)
AS_OBJS := $(AS_SRC:%.S=$(OBJDIR)%.o)
AS_DEPS := $(AS_OBJS:%=%.d)
OBJS := $(C_OBJS) $(CPP_OBJS) $(AS_OBJS)
DEPS := $(C_DEPS) $(CPP_DEPS) $(AS_DEPS)
.SECONDARY : $(OBJS) $(DEPS)
lst: $(PRG).lst
elf: $(PROGDIR)$(PRG).elf
.SECONDARY : $(PROGDIR)$(PRG).elf
#####################################
# Test for ARM architecture
ifneq (,$(findstring $(MCU_TARGET),$(ARM_MCUs)))
hex: $(PRG).hex
bin: $(PRG).bin
srec: $(PRG).srec
fhex: hex
fbin: bin
fsrec: srec
ehex:
ebin:
esrec:
LD_FLAGS += -T $(LD_MEMORY_SCRIPT)
LD_FLAGS += -T sections.ld
CC_FLAGS := -D$(MCU_TARGET)
CC_FLAGS += -nostartfiles -mthumb -march=armv7e-m
CC_FLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -specs=nosys.specs
CC := arm-none-eabi-gcc $(CC_FLAGS)
OBJCOPY := arm-none-eabi-objcopy
OBJDUMP := arm-none-eabi-objdump
# for ARM those vars are empty
rm-eeprom-files =
make-heap-start-h =
rm-heap-start-h =
make-crc-of-hex =
getcrc_hex =
make-crc-of-bin =
getcrc_bin =
#####################################
# Test for AVR architecture
else ifneq (,$(findstring $(MCU_TARGET),$(AVR_MCUs)))
ifneq (,$(strip $(DATA_START)))
# память, распределяемая вручную, располагается по младшим адресам
LD_FLAGS += -Wl,--section-start,.data=$(DATA_START)
endif
# байт EEPROM с адресом 0 не используем
LD_FLAGS += -Wl,--section-start,.eeprom=0x810001
hex: fhex ehex
bin: fbin ebin
srec: fsrec esrec
fhex: $(PRG).hex
fbin: $(PRG).bin
fsrec: $(PRG).srec
ehex: $(PRG)_eeprom.hex
ebin: $(PRG)_eeprom.bin
esrec: $(PRG)_eeprom.srec
C_FLAGS += -mstrict-X
CPP_FLAGS += -mstrict-X
CC_FLAGS := -mmcu=$(MCU_TARGET)
ifneq (,$(strip $(FIXED_REGS)))
$(foreach reg,$(FIXED_REGS),$(eval CC_FLAGS += -ffixed-$(reg)))
endif
CC := avr-gcc $(CC_FLAGS)
OBJCOPY := avr-objcopy -j .text -j .data
EEPROMCOPY := avr-objcopy -j .eeprom --change-section-lma .eeprom=1
OBJDUMP := avr-objdump
define rm-eeprom-files
-@$(RM) -rf $(PRG)_eeprom.hex $(PRG)_eeprom.bin $(PRG)_eeprom.srec
endef
#####################################
# helper for make 'heap-start.h' file
#
ifdef MAKE_HEAP_START_H
define make-heap-start-h
@$(ECHO) "/* DO NOT EDIT THIS FILE! */" > new-heap-start.h
@$(ECHO) "/* This file is auto generated */" >> new-heap-start.h
@$(SED) -e "/_Heap_Begin/!d" \
-r -e "s/([[:space:]]*0x)([^[:space:]]+).*/#define HEAP_START 0x\2/" \
$(PROGDIR)$(PRG).map >> new-heap-start.h
@$(SED) -e "/_Heap_Limit/!d" \
-r -e "s/([[:space:]]*0x)([^[:space:]]+).*/#define HEAP_END 0x\2/" \
$(PROGDIR)$(PRG).map >> new-heap-start.h
@if $(CMP) -s new-heap-start.h heap-start.h ; \
then $(RM) new-heap-start.h ; \
else $(MV) -f new-heap-start.h heap-start.h ; \
$(MAKE) $(PROGDIR)$(PRG).elf ; \
fi
endef
define rm-heap-start-h
-@$(RM) heap-start.h
endef
else
make-heap-start-h =
rm-heap-start-h =
endif
#
# helper for make 'heap-start.h' file
#####################################
#####################################
# helper for make crc of programm file
#
ifdef MAKE_CRC_OF_FILE
define GETCRC_SOURCE_HEX
/* getcrc-hex.c */
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
unsigned short int CRC = 0;
unsigned long int FINISH = 0;
unsigned short int ByteCRC( unsigned short int CRC, unsigned char c )
{
int i;
CRC ^= c;
for ( i = 0; i < 8; ++i ) if ( CRC & 1 ) { CRC >>= 1; CRC ^= 0xA001; }
else CRC >>= 1;
return CRC;
} // ByteCRC
unsigned char ReadNibble( void )
{
int ch = getchar();
if ( EOF == ch ) return 0;
ch = toupper( ch );
if ( ch >= 'A' ) ch = 10 + ch - 'A';
else ch = ch - '0';
return ch;
} // ReadNibble
#define ReadByte() ((ReadNibble() << 4) + ReadNibble())
int ReadLine( void )
{
int bytes;
int addr;
int ch = getchar();
if ( EOF == ch ) return 0;
if ( ':' != ch ) exit(1);
bytes = ReadByte();
addr = ReadByte() * 256u + ReadByte();
if ( !ReadByte() )
{
if ( !FINISH ) FINISH = addr;
else if ( FINISH != addr ) exit(1);
for ( ; bytes; -- bytes )
{
CRC = ByteCRC( CRC, ReadByte() );
++FINISH;
}
}
while ( (EOF != ch) && ('\n' != ch) ) ch = getchar();
return 1;
} // ReadLine
int main( void )
{
while ( ReadLine() ) (void)0;
int sum = (0-(2 + (FINISH >> 8) + FINISH + CRC + (CRC >> 8))) & 0xff;
printf( ":02%04X00%02X%02X%02X\n", (int)FINISH, (int)(CRC & 0xFF),
(int)((CRC >> 8) & 0xFF), (int)(sum) );
return 0;
} // main
/* End of file getcrc-hex.c */
endef
getcrc_hex := getcrc-hex.exe
.INTERMEDIATE : $(getcrc_hex) getcrc-hex.c
$(getcrc_hex) : getcrc-hex.c
$(HOST_CC) getcrc-hex.c -o $@
export GETCRC_SOURCE_HEX
getcrc-hex.c :
$(ECHO) "$${GETCRC_SOURCE_HEX}" > getcrc-hex.c
define make-crc-of-hex
$(HEAD) --lines=-1 $@ > n-$@
./$(getcrc_hex) < $@ >> n-$@
$(ECHO) :00000001FF >> n-$@
$(MV) n-$@ $@
endef
define GETCRC_SOURCE_BIN
/* getcrc-bin.c */
#include <stdio.h>
unsigned short int CRC = 0;
unsigned short int ByteCRC( unsigned short int CRC, unsigned char c )
{
int i;
CRC ^= c;
for ( i = 0; i < 8; ++i ) if ( CRC & 1 ) { CRC >>= 1; CRC ^= 0xA001; }
else CRC >>= 1;
return CRC;
} // ByteCRC
int main( void )
{
int ch;
while ( (ch = getchar()) != EOF ) CRC = ByteCRC( CRC, ch );
printf( "%c%c", (char)(CRC & 0xFF), (char)((CRC >> 8) & 0xFF) );
return 0;
} // main
/* End of file getcrc-bin.c */
endef
getcrc_bin := getcrc-bin.exe
.INTERMEDIATE : $(getcrc_bin) getcrc-bin.c
$(getcrc_bin) : getcrc-bin.c
$(HOST_CC) getcrc-bin.c -o $@
export GETCRC_SOURCE_BIN
getcrc-bin.c :
$(ECHO) "$${GETCRC_SOURCE_BIN}" > getcrc-bin.c
define make-crc-of-bin
$(CP) $@ n-$@
./$(getcrc_bin) < $@ >> n-$@
$(MV) n-$@ $@
endef
else
make-crc-of-hex =
getcrc_hex =
make-crc-of-bin =
getcrc_bin =
endif
#
# helper for make crc of programm file
#####################################
%_eeprom.hex: $(PROGDIR)%.elf
@if [ -e $@ ] ; then $(RM) $@ 2> /dev/nul ; fi
ifeq ($(MAKECMDGOALS),eeprom)
@$(EEPROMCOPY) -O ihex $< $@
else ifeq ($(MAKECMDGOALS),ehex)
@$(EEPROMCOPY) -O ihex $< $@
else
-@$(EEPROMCOPY) -O ihex $< $@
endif
%_eeprom.srec: $(PROGDIR)%.elf
@if [ -e $@ ] ; then $(RM) $@ 2> /dev/nul ; fi
ifeq ($(MAKECMDGOALS),eeprom)
@$(EEPROMCOPY) -O srec $< $@
else ifeq ($(MAKECMDGOALS),esrec)
@$(EEPROMCOPY) -O srec $< $@
else
-@$(EEPROMCOPY) -O srec $< $@
endif
%_eeprom.bin: $(PROGDIR)%.elf
@if [ -e $@ ] ; then $(RM) $@ 2> /dev/nul ; fi
ifeq ($(MAKECMDGOALS),eeprom)
@$(EEPROMCOPY) -O binary $< $@
else ifeq ($(MAKECMDGOALS),ebin)
@$(EEPROMCOPY) -O binary $< $@
else
-@$(EEPROMCOPY) -O binary $< $@
endif
else
$(error Unknown MCU target: '$(MCU_TARGET)' (see rulers.mk))
endif
# finish architectur specific part
#####################################
#####################################
# Invariant part
#
skip-line = $(if $(findstring j,$(MAKEFLAGS)),,$(info ))
ifeq ($(MAKE_VERSION),4.2.1)
slash:=\\\\
define make-objs-list
$(file > $(PROGDIR)$(PRG)-objs-list)
$(foreach name,$(OBJS),$(file >> $(PROGDIR)$(PRG)-objs-list,$(name)))
endef
else ifeq ($(MAKE_VERSION),4.1)
slash:=\\\\
define make-objs-list
$(file > $(PROGDIR)$(PRG)-objs-list)
$(foreach name,$(OBJS),$(file >> $(PROGDIR)$(PRG)-objs-list,$(name)))
endef
else ifeq ($(MAKE_VERSION),4.0)
$(error Unchecked version of 'make')
else
slash:=\\\\\\\\
$(shell $(ECHO)> $(PROGDIR)$(PRG)-objs-list)
$(foreach name,$(OBJS),$(shell $(ECHO) $(name)>>$(PROGDIR)$(PRG)-objs-list))
make-objs-list=
endif # MAKE_VERSION
$(PROGDIR)$(PRG).elf : $(OBJS)
$(call make-objs-list)
$(CC) $(C_FLAGS) $(LD_FLAGS) -Wl,@$(PROGDIR)$(PRG)-objs-list -o $@
$(call make-heap-start-h)
$(call skip-line)
%.lst: $(PROGDIR)%.elf
@if [ -e $@ ] ; then $(RM) $@ 2> /dev/nul ; fi
$(OBJDUMP) -h -s -S $< > $@
%.hex: $(PROGDIR)%.elf $(getcrc_hex)
@if [ -e $@ ] ; then $(RM) $@ 2> /dev/nul ; fi
$(OBJCOPY) -O ihex $< $@
$(call make-crc-of-hex)
%.srec: $(PROGDIR)%.elf
@if [ -e $@ ] ; then $(RM) $@ 2> /dev/nul ; fi
$(OBJCOPY) -O srec $< $@
%.bin: $(PROGDIR)%.elf $(getcrc_bin)
@if [ -e $@ ] ; then $(RM) $@ 2> /dev/nul ; fi
$(OBJCOPY) -O binary $< $@
$(call make-crc-of-bin)
# proc-dep-file lang (compiled_file_name.o.d)
# 1 (reformat list of source files)
# 1.1 convert dos eol to unix eol
# 1.2 convert last on line \ to #
# 1.3 convert \ in filename to /
# 1.4 restore to \ last on line #
# 1.5 on the first line put target file name and dependence file name
# 2.1 delete empty lines
# 2.2 change the first line to 'SRC_FILES += \'
# (all source files will be in SRC_FILES list)
# 2.3 add blank line after the last line
# 3.1 delete empty lines
# 3.2 delete first line
# 3.3 delete initial spaces on lines
# 3.4 change last on line \ to :
# (all source files need to exist in future build processes)
# 3.5 add : on the last line and blank line after the last line
# 4.1 delete emtpy lines
# 4.2 add source files and makefiles
define proc-dep-file
@$(SED) -e 's/\r//' -e 's/\\$$/#/' -e 'sa\\a/ag' -e 's/#$$/\\/' \
-e "1s/.*:/$(subst /,\/,$@) $(subst /,\/,$@.d): $(slash)\n/" \
< $@.d > $@.p.d
@$(SED) -e '/^[ \t]*\\*$$/d' -e '1s/.*:/SRC_FILES +=/' -e '$$s/$$/\n/' \
< $@.p.d > $@.d
@$(SED) -e '/^[ \t]*\\*$$/d' -e '1d' -e 's/^[ \t]*//' -e 's/\\$$/:/' \
-e '$$s/$$/ :\n/' \
< $@.p.d >> $@.d
@$(SED) -e '/^[ \t]*\\*$$/d' \
-e "\$$s/$$/ $(slash)\n $(subst /,\/,$($(strip $(1))_MK_FILES_$<))/" \
< $@.p.d >> $@.d
@$(RM) $@.p.d
endef
# make-obj lang
define make-obj
$(CC) -MMD -MF $@.d -c $($(strip $(1))_FLAGS) \
$($(strip $(1))_FLAGS_$<) $< -o $@
$(call proc-dep-file,$(1))
$(call skip-line)
endef
$(C_OBJS) : $(OBJDIR)%.o : %.c
$(call make-obj,C)
$(CPP_OBJS) : $(OBJDIR)%.o : %.cpp
$(call make-obj,CPP)
$(AS_OBJS) : $(OBJDIR)%.o : %.S
$(call make-obj,AS)
clean:
-@$(RM) -rf $(PROGDIR)$(PRG).elf
-@$(RM) -f $(PROGDIR)$(PRG)-objs-list
-@$(RM) -rf $(PRG).lst $(PROGDIR)$(PRG).map
-@$(RM) -rf $(PRG).hex $(PRG).bin $(PRG).srec
-@$(RM) -rf $(MK_DIRS:%=%/*.o) $(MK_DIRS:%=%/*.o.d)
-@$(RM) -f tags cscope.out
$(call rm-heap-start-h)
$(call rm-eeprom-files)
# include dep. files
ifneq "$(MAKECMDGOALS)" "clean"
-include $(DEPS)
endif
ifeq "tag" "$(findstring tag,$(subst tags,tag,$(MAKECMDGOALS)))"
# make-dep lang
define make-dep
$(CC) -MM $($(strip $(1))_FLAGS) $($(strip $(1))_FLAGS_$<) $< -o $@.d
$(call proc-dep-file,$(1))
$(call skip-line)
endef
$(C_DEPS) : $(OBJDIR)%.o.d : %.c
$(call make-dep,C)
$(CPP_DEPS) : $(OBJDIR)%.o.d : %.cpp
$(call make-dep,CPP)
$(AS_DEPS) : $(OBJDIR)%.o.d : %.S
$(call make-dep,AS)
ifeq ($(MAKE_VERSION),4.2.1)
define make-srcs-list
$(file > $(PROGDIR)$(PRG)-srcs-list)
$(foreach name,$(sort $(SRC_FILES)),$(file >> $(PROGDIR)$(PRG)-srcs-list,$(name)))
endef
else ifeq ($(MAKE_VERSION),4.1)
define make-srcs-list
$(file > $(PROGDIR)$(PRG)-srcs-list)
$(foreach name,$(sort $(SRC_FILES)),$(file >> $(PROGDIR)$(PRG)-srcs-list,$(name)))
endef
else ifeq ($(MAKE_VERSION),4.0)
$(error Unchecked version of 'make')
else
$(shell $(ECHO)> $(PROGDIR)$(PRG)-srcs-list)
$(foreach name,$(sort $(SRC_FILES)),$(shell $(ECHO) $(name)>>$(PROGDIR)$(PRG)-srcs-list))
make-srcs-list=
endif # MAKE_VERSION
tag: tags
tags: $(SRC_FILES)
$(call make-srcs-list)
if [ -e tags ] ; then $(CTAGS) -u -L $(PROGDIR)$(PRG)-srcs-list ; \
else $(CTAGS) -L $(PROGDIR)$(PRG)-srcs-list ; fi
$(CSCOPE) -U -b -i$(PROGDIR)$(PRG)-srcs-list
endif
# Create directories
$(shell $(MKDIR) $(MK_DIRS) 2>/dev/null)
#
# End of file rules.mk