summaryrefslogtreecommitdiff
path: root/firmware/test/makefile-rules
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test/makefile-rules')
-rw-r--r--firmware/test/makefile-rules118
1 files changed, 0 insertions, 118 deletions
diff --git a/firmware/test/makefile-rules b/firmware/test/makefile-rules
deleted file mode 100644
index 320d05a6c2..0000000000
--- a/firmware/test/makefile-rules
+++ /dev/null
@@ -1,118 +0,0 @@
1#############################################################################
2## __________ __ ___.
3## Open \______ \ ____ ____ | | _\_ |__ _______ ___
4## Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5## Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6## Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7## \/ \/ \/ \/ \/
8## Copyright Alan Korr, 2002. All rights reserved.
9##
10## Permission to use, copy, modify, and distribute this software for any
11## purpose is hereby granted without fee, provided that this copyright and
12## permissions notice appear in all copies and derivatives, and that no
13## charge may be made for the software and its documentation except to cover
14## cost of distribution.
15##
16## This software is provided "as is" without express or implied warranty.
17#############################################################################
18
19#######################################################################
20## PLEASE CONSIDER THERE IS NOTHING TO CHANGE IN THE FOLLOWING LINES
21## SINCE THERE ARE COMMON FOR ALL LIBRARY
22##
23
24.SUFFIXES : .o .c .s
25
26%.o: %.c
27 @echo "Compiling" $<...
28 @$(CC) -o $(@) $(CFLAGS) $(INCLUDES) -c $<
29 @$(CC) -M $< $(CFLAGS) $(INCLUDES) > $(*F).d
30
31%.o: %.s
32 @echo "Assembling" $<...
33 @$(CC) -o $(@) $(CFLAGS) $(INCLUDES) -c $<
34 @$(CC) -M $< $(CFLAGS) $(INCLUDES) > $(*F).d
35
36.PHONY: splash all clean backup restore dist install
37
38all: splash $(LIBRARY) test
39
40splash:
41 @echo "<<< " $(PACKAGE) "-" $(VERSION) ">>>"
42
43####################################################
44# LIBRAY PART :
45
46$(LIBRARY): $(OBJECTS)
47 @echo "Creating library" $(LIBRARY)...
48 @$(AR) cru $(@) $(OBJECTS)
49 @$(RL) $(@)
50
51####################################################
52# TEST PART :
53
54test: test.tab.o test.lex.o $(LIBRARY)
55 @echo "Creating executable" $@...
56 @$(CC) -g -o $(@) $(INCLUDES) $(+) -lfl -lreadline
57
58test.tab.o: test.tab.c
59 @echo "Compiling" $<...
60 @$(CC) $(INCLUDES) $(DEFINES) -g -o $(@) -O3 -fomit-frame-pointer -c test.tab.c
61
62test.lex.o: test.lex.c
63 @echo "Compiling" $<...
64 @$(CC) $(INCLUDES) $(DEFINES) -g -o $(@) -O3 -fomit-frame-pointer -c test.lex.c
65
66test.tab.h: test.tab.c
67
68test.lex.c: test.l test.tab.h
69 @echo "Flex:" $<
70 @flex -otest.lex.c test.l
71
72test.tab.c: test.y
73 @echo "Bison:" $<
74 @bison -d test.y
75
76
77####################################################
78# MISCELLANOUS PART :
79
80clean:
81 @rm -f $(LIBRARY)
82 @rm -f $(OBJECTS) test.lex.o test.tab.o
83 @rm -f $(DEPENDENCIES)
84 @rm -f *~ test test.exe
85 @rm -f test.tab.h test.tab.c test.lex.c
86 @rm -f core
87
88backup:
89 @mkdir -p ./backup
90 @cp -f makefile ./backup
91 @cp -f test.l ./backup
92 @cp -f test.y ./backup
93 @cp -f $(SOURCES:.c=.txt) ./backup
94 @for header in $(HEADERS) ; do cp -f $$header ./backup ; done
95 @for source in $(SOURCES) ; do cp -f $$source ./backup ; done
96
97restore:
98 @cp -f ./backup/makefile .
99 @cp -f ./backup/test.l .
100 @cp -f ./backup/test.y .
101 @cp -f ./backup/$(SOURCES:.c=.txt)
102 @for header in $(HEADERS) ; do cp -f ./backup/$$header . ; done
103 @for source in $(SOURCES) ; do cp -f ./backup/$$source . ; done
104
105dist: backup
106 @mv backup $(PACKAGE)
107 @tar czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)/*
108 @rm -f $(PACKAGE)/*
109 @rmdir $(PACKAGE)
110
111install: all
112 @mkdir -p $(PREFIX)/libraries
113 @cp $(LIBRARY) $(PREFIX)/libraries
114 @mkdir -p $(PREFIX)/headers/$(PACKAGE)
115 @for header in $(HEADERS) ; do cp $$header $(PREFIX)/headers/$(PACKAGE) ; done
116
117-include $(DEPENDENCIES)
118