summaryrefslogtreecommitdiff
path: root/exar/Makefile
blob: c8db4a4baae3ee943719cbbad4c7bb08cca4e03e (plain)
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
ORIG_CFLAGS := $(CFLAGS)

CFLAGS := -Wall -pedantic -Werror -Wextra -std=c99 -Os
CFLAGS += $(ORIG_CFLAGS)

DCFLAGS += -g -O0 -Wall -pedantic -Werror -Wextra -std=c99 
DCFLAGS += $(ORIG_CFLAGS)

TARGET = exar
OBJ = $(patsubst %.c, %.o, $(wildcard *.c))

SHARED_OBJ = exar.o 

all: $(SHARED_OBJ)

$(TARGET): $(OBJ)
	@echo $(CC) -o $@
	@$(CC) $(OBJ) -o $@ $(CFLAGS) $(CPPFLAGS)

%.o: %.c 
	@echo $(CC) $< 
	@$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)

debug: 
	make CFLAGS="$(DCFLAGS)"

cgdb: 
	make CFLAGS="$(DCFLAGS)"
	cgdb exar

clean: 
	$(RM) -rf $(OBJ) $(TARGET)

.PHONY: clean