Makefile 473 Bytes
Newer Older
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
1
2
TARGET = main
LIBS =
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
3
CC = g++
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
4
CFLAGS = -O3 -Wno-write-strings # -g -pg -fstack-usage 
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

.PHONY: default all clean

default: $(TARGET)
all: default

OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c))
HEADERS = $(wildcard *.h)

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

.PRECIOUS: $(TARGET) $(OBJECTS)

$(TARGET): $(OBJECTS)
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
20
	$(CC) $(OBJECTS) -static -static-libgcc -static-libstdc++ -Wl,--stack,16777216 -Wall $(LIBS) -o $@ # -pg -g
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
21
22
23
24

clean:
	-rm -f *.o
	-rm -f $(TARGET)