aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: cd3480154e98ff5bce4ca8d2da2e379b93b126d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CXX = g++
CXXFLAGS = -Wall -Wextra -std=gnu++11 -g -fwrapv -I$(FLTK)/include
LDFLAGS = -L$(FLTK)/lib -lfltk
TARGETS = sim gui

FLTK = /usr/local/opt/fltk

.PHONY: all clean remake

all: $(TARGETS)

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

remake: clean
	$(MAKE) all


$(TARGETS): %: %.o $(filter-out $(addsuffix .o,$(TARGETS)),$(patsubst %.cpp,%.o,$(wildcard *.cpp)))
	$(CXX) -o $@ $^ $(LDFLAGS)

%.o: %.cpp $(wildcard *.h)
	$(CXX) $(CXXFLAGS) -c -o $@ $<