-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (38 loc) · 1.45 KB
/
Makefile
File metadata and controls
59 lines (38 loc) · 1.45 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
# Nombre del compilador
CC = gcc
# Flags del compilador (modo debug por defecto)
CFLAGS = -Iinclude -lcurl -DDEBUG -Wall
# Flags del compilador para la compilación estática (sin debug)
STATIC_CFLAGS = -Iinclude -static -lcurl
# Flags del compilador para sistemas legacy (modo debug por defecto)
CFLAGS_LEGACY = -Iinclude -lcurl -DDEBUG -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -DLEGACY_COMPILATION
# Flags del compilador para la compilación estática en sistemas legacy (sin debug)
STATIC_CFLAGS_LEGACY = -Iinclude -static -lcurl -std=c99 -lpthread -lrt -D_POSIX_C_SOURCE=200112L -DLEGACY_COMPILATION
# Nombre del archivo ejecutable
TARGET = elfMemExecutor
# Nombre del archivo ejecutable estático
STATIC_TARGET = elfMemExecutor
# Directorio de origen
SRC_DIR = src
# Archivos fuente
SRC = $(wildcard $(SRC_DIR)/*.c)
# Reglas por defecto
all: $(TARGET)
# Regla para compilar el ejecutable
$(TARGET): $(SRC)
$(CC) -o $@ $(SRC) $(CFLAGS)
# Regla para compilar el ejecutable estático
static: $(SRC)
$(CC) -o $(STATIC_TARGET) $(SRC) $(STATIC_CFLAGS)
# Regla para limpiar archivos compilados
clean:
rm -f $(TARGET) $(STATIC_TARGET)
# Regla para compilar en sistemas legacy
legacy: $(SRC)
$(CC) -o $(TARGET) $(SRC) $(CFLAGS_LEGACY)
# Regla para compilar el ejecutable estático en sistemas legacy
legacy_static: $(SRC)
$(CC) -o $(STATIC_TARGET) $(SRC) $(STATIC_CFLAGS_LEGACY)
# Regla para reconstruir
rebuild: clean all
.PHONY: all clean rebuild static