aboutsummaryrefslogtreecommitdiff
path: root/zinclib.d/test/Makefile
blob: 84938e656c4aaf56c3ed15c9b189103d35f1e3d5 (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
35
36
########################################
#       zinclib tests makefile
########################################

# list of tests to make
EXECS = items widget test itemconf

# default : all tests
all: $(EXECS)

# usefull commons
include ../../../v0.1/common.mk

# specific options
INCLUDE   = -I../src
LIBDIR    = ../tmp
LDFLAGS  += -L../../../v0.1/lib -ltcl8.4 -ltk8.4 -lTkZinc $(LIBDIR)/zinclib.o

# generic target
%.o: %.cpp
	$(CXX) $(CXXFLAGS) -o $@ -c $<

clean:
	rm -f *.o $(PROFFILES) $(EXECS) core.* *.exe

clean_code: clean
	rm -f *~ .\#*

# function to create a target for each test
define funct
$(1): $(1).o $(LIBDIR)/zinclib.o
	$$(GCC) $$(LDFLAGS) -o $$@ $$<
endef

# create a target for each test
$(foreach prog,$(EXECS),$(eval $(call funct,$(prog))))