-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (49 loc) · 1.5 KB
/
Copy pathMakefile
File metadata and controls
62 lines (49 loc) · 1.5 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
# ============================================================================
# Name : Makefile
# Author : Alberto Realis-Luc <alberto.realisluc@gmail.com>
# Copyright : (C) 2004 Alberto Realis-Luc
# License : GNU GPL v2
# Repository : https://github.com/alus-it/CodiceFiscale
# Web : http://www.alus.it/pubs/CodiceFiscale
# Description : Makefile of CF program to generate Italian fiscal codes
# ============================================================================
# CF version string
VERSION = 1.5
# Compiler and linker options
WARN_CFLAGS = -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wno-unused-parameter -Werror
CFLAGS = -c -O3 -fPIC $(WARN_CFLAGS) #-std=gnu99
#LFLAGS =
# Source and binary paths
SRC = src/
BIN = bin/
# Headers for others external libs path (TomTom stuff)
#INC = include/
# List of C source files
CFILES = \
cf.c \
main.c
# List of object files
OBJS = $(patsubst %.c, $(BIN)%.o, $(CFILES))
# Final executable destination folder
DIST = ./
### Build
all: $(DIST)cf
$(DIST)cf: $(OBJS)
@echo Linking all into: $@
@gcc $(LFLAGS) $(OBJS) -o $@
@strip $@
# Create bin directory if missing
$(OBJS): | $(BIN)
$(BIN):
mkdir -p $(BIN)
$(BIN)main.o: $(SRC)main.c $(SRC)cf.h
@echo Compiling: $<
@gcc $(CFLAGS) -D'VERSION="$(VERSION)"' $< -o $@
$(BIN)cf.o: $(SRC)cf.c $(SRC)cf.h
@echo Compiling: $<
@$gcc $(CFLAGS) $< -o $@
### Clean
clean:
@echo Cleaning: objects and executable
@rm -rf $(BIN)
@rm -f $(DIST)cf