-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (58 loc) · 1.66 KB
/
Makefile
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
#
# Semplice makefile per compilare i programmi necessari ..
#
# System environment
CC = gcc
CODEGEN =
OPTIMIZATION = -O0
# OPTIONS = -D_MG_BIG_ENDIAN_ -D_MG_NCURSES_
OPTIONS =
DEBUG = -g
DEBUG_FLAG = -DDEBUG
SIMULATE_FLAG = -DNOPI
SIMDEBUG_FLAG = -DDEBUG -DNOPI
PRJ=pimorse.c
PRGS=pimorse
# CFLAGS = $(CODEGEN) $(OPTIMIZATION) $(OPTIONS) $(DEBUG)
CFLAGS = $(CODEGEN) $(OPTIMIZATION) $(OPTIONS)
#LIB = -lncurses -lwiringPi
LIB = -lwiringPi
# LIB =
# COMPLINK = $(CC) $(CFLAGS) $(INCL) $(DEBUG) -Wall $(LIB)
# COMPILE = $(CC) $(CFLAGS) $(INCL) $(DEBUG) $(DEBUG_FLAG) $(SIMULATE_FLAG) $(SIMDEBUG_FLAG) -Wall -c
COMPLINK = $(CC) $(CFLAGS) $(INCL) -Wall $(LIB)
COMPILE = $(CC) $(CFLAGS) $(INCL) -Wall -c
#SOURCES = pimorse.c myutils.c
SOURCES = pimorse.c
# OBJ = presta.o senal.o strfunz.o
OBJ = ${SOURCES:.c=.o}
# all: presta senal
all: pimorse
## For debug,simulate,simdebug: Compile and link in one step.
debug:
$(CC) $(CFLAGS) $(INCL) $(DEBUG) $(DEBUG_FLAG) $(LIB) -Wall -o pimorse pimorse.c
simulate:
$(CC) $(CFLAGS) $(INCL) $(DEBUG) $(SIMULATE_FLAG) -Wall -o pimorse pimorse.c
simdebug:
$(CC) $(CFLAGS) $(INCL) $(DEBUG) $(SIMDEBUG_FLAG) -Wall -o pimorse pimorse.c
# presta: strfunz.o presta.o
# $(COMPLINK) -o $@ presta.o strfunz.o
# senal: strfunz.o senal.o
# $(COMPLINK) -o $@ senal.o strfunz.o
# pimorse: pimorse.o myutils.o strfunz.o
# $(COMPLINK) -o $@ pimorse.o
#
#pimorse: pimorse.o myutils.o
pimorse: pimorse.o
$(COMPLINK) -o $@ $^
#pimorse.o: pimorse.c pimorse.h myproto.h
pimorse.o: pimorse.c
$(COMPILE) pimorse.c
#strfunz.o: strfunz.c strfunz.h
# $(COMPILE) strfunz.c
#
#myutils.o: myutils.c
# $(COMPILE) myutils.c
.PHONY: clean
clean:
rm -f $(PRGS) $(OBJ) *~