summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 84324041b4242cee053acd1a21380d630b503e3c (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
BINS = ascii class depipe_strings dup fpipe pipe realloc strpbrk strsep \
       tokenizer getopt prime_mask linked_list pi_bbp string_tokenizer  \
       tcpserver tcpclient regexp c99 asm playground_05-25-2011 \
       parent_to_child funcptrs

CURL = curl_tomem curl_tofile

CC = gcc
CFLAGS = -Wall -std=gnu99 -pedantic
DBGFLAGS = -g -O0
ifdef DEBUG
    CFLAGS += $(DBGFLAGS) -D DEBUG
else
    CFLAGS += -O2 -mtune=native -march=native
endif
LDFLAGS = -lm

all: $(BINS) $(CURL)

$(BINS): %: %.c
	$(CC) $(CFLAGS) $^ -o $@

$(CURL): %: %.c
	$(CC) `curl-config --libs` $(CFLAGS) $^ -o $@

.PHONY: clean

clean:
	@rm -f ./$(BINS) ./$(CURL)