forked from WaffleBuffer/Workbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (35 loc) · 931 Bytes
/
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
SHELL = /bin/bash
CC = gcc
CFLAGS = -Wall -W -std=c99 -pedantic -I.
LIBS =
LINKER = gcc -o
# linking flags here
LFLAGS = -Wall -I. -lm
SRCDIR = src
OBJDIR = obj
BINDIR = bin
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(SRCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
rm = rm -f
# project name (generate executable with this name)
TARGET = Workbench
$(BINDIR)/$(TARGET): $(OBJECTS)
@$(LINKER) $@ $(LFLAGS) $(OBJECTS)
@echo "Linking complete!"
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@$(CC) $(CFLAGS) -c $< -o $@
@echo "Compiled "$<" successfully!"
$(EXECSUTIL) : %: %.o bor-util.o
$(CC) -o $@ [email protected] bor-util.o $(LIBS)
.c.o :
$(CC) -c $(CFLAGS) $*.c
help ::
@echo "Options du make : help all clean remove"
all :: $(TARGET)
clean ::
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"
remove :: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed!"