-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (55 loc) · 1.44 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
#
# Semplice makefile per compilare i programmi necessari ..
#
inc := /usr/include/mysql
lib := /usr/lib64/mysql
# System environment
CC = gcc
CODEGEN =
OPTIMIZATION = -O0
# OPTIONS = -D_MG_BIG_ENDIAN_ -D_MG_NCURSES_
# OPTIONS = -DDEBUG
DEBUG = -g
PRJ=gencachemdir.c
# CFLAGS = $(CODEGEN) $(OPTIMIZATION) $(OPTIONS) $(DEBUG)
CFLAGS = $(CODEGEN) $(OPTIMIZATION) $(OPTIONS)
CPPFLAGS := -I$(inc) -D_THREAD_SAFE -D_REENTRANT
#LIB = -lncurses
#LIB = -lpcap
#LIB =
LIB = -L$(lib) -lmysqlclient -lz -lm -lcrypt
COMPLINK = $(CC) $(CFLAGS) $(CPPFLAGS) $(INCL) -Wall
COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) $(INCL) -Wall -c
SOURCES = gencachemdir.c
# OBJ = presta.o senal.o strfunz.o
OBJ = ${SOURCES:.c=.o}
PRGS = ${SOURCES:.c=}
ifneq (,$(shell grep FreeBSD /COPYRIGHT 2>/dev/null))
# FreeBSD
LDFLAGS += -pthread
else
# Assume Linux
LDLIBS += -lpthread
endif
all: gencachemdir
# presta: strfunz.o presta.o
# $(COMPLINK) -o $@ presta.o strfunz.o
# senal: strfunz.o senal.o
# $(COMPLINK) -o $@ senal.o strfunz.o
# gencachemdir: gencachemdir.o
# $(COMPLINK) -o $@ gencachemdir.o $(LIB)
#
gencachemdir: gencachemdir.o strfunz.o
$(COMPLINK) -o $@ $^ $(LIB)
gencachemdir.o: gencachemdir.c
$(COMPILE) gencachemdir.c
# strfunz.o: strfunz.c
# $(COMPILE) strfunz.c
somiglia: somiglia.o strfunz.o
$(COMPLINK) -o $@ $^
somiglia.o: somiglia.c
$(COMPILE) somiglia.c
strfunz.o: strfunz.c strfunz.h
$(COMPILE) strfunz.c
clean:
rm -f $(PRGS) $(OBJ) *~ *.o somiglia