tecmake.dist 1.17 KB
Newer Older
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

INCDIR = ../include
TARGETDIR = ../bin/$(TEC_UNAME)
OBJDIR = ../obj/$(TEC_UNAME)

## Compilation Parameters

WARNINGS =
DEFS  := -DTEC_UNAME=$(TEC_UNAME) -DTEC_SYSNAME=$(TEC_SYSNAME) -D$(TEC_SYSNAME)=$(TEC_SYSRELEASE) -DFUNCPROTO=15 $(DEFINES)
CFLAGS   = $(FLAGS) $(WARNINGS) $(INCLUDES) $(DEFS)
CXXFLAGS = $(CPPFLAGS) $(WARNINGS) $(INCLUDES) $(DEFS)


## Generic Main Rules

application: $(TARGETDIR)/$(TARGETNAME)
dynamic: $(TARGETDIR)/lib$(TARGETNAME).so 
static: $(TARGETDIR)/lib$(TARGETNAME).a
libs: static dynamic

$(TARGETDIR)/$(TARGETNAME) : $(TARGETDIR) $(OBJS)
	$(LINKER) -o $@ $(OBJS) $(SLIB) $(LFLAGS)
	@if [ ! -z "$(STRIP)" ]; then \
	   echo "Striping debug information" ;\
	   strip $@ ;\
	fi
	@echo 'Application Done.'

$(TARGETDIR)/lib$(TARGETNAME).so : $(OBJS)
	geraso $(TARGETDIR) $(TARGETNAME) $(OBJS)
	@echo 'Dynamic Library Done.'

$(TARGETDIR)/lib$(TARGETNAME).a : $(OBJS)
	ar r $@ $?
	-ranlib $@
	@echo 'Static Library Done.'

$(TARGETDIR): ;
	mkdir $@

## Implicit Rules

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

.cpp.o:
	$(CC) -c $(CXXFLAGS) -o $@ $<

clean:
	rm -fr *.o so_locations

clean-all:
	rm -fr *.o $(TARGETDIR)/$(TARGETNAME) $(TARGETDIR)/lib$(TARGETNAME).* so_locations