-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
47 lines (37 loc) · 1.07 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
# ------------------------------------------------
# Generic Makefile
#
# Author: [email protected]
# Date : 2011-08-10
#
# Changelog :
# 2010-11-05 - first version
# 2011-08-10 - added structure : sources, objects, binaries
# thanks to http://stackoverflow.com/users/128940/beta
# ------------------------------------------------
# project name (generate executable with this name)
TARGET = fwtool
CC = gcc
# compiling flags here
CFLAGS = -Wall -DNDEBUG -DIOAPI_NO_64 -DFWT_CONSOLE
LINKER = gcc -o
# linking flags here
LDFLAGS = -lz -larchive
# change these to set the proper directories where each files shoould be
SRCDIR = src
OBJDIR = obj
BINDIR = bin
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(SRCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
rm = rm -f
$(BINDIR)/$(TARGET): $(OBJECTS)
$(LINKER) $@ $(OBJECTS) $(LDFLAGS)
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONEY: clean
clean:
@$(rm) $(OBJECTS)
.PHONEY: remove
remove: clean
$(rm) $(BINDIR)/$(TARGET)