-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
executable file
·73 lines (59 loc) · 1.79 KB
/
makefile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# Makefile for NetMon
# Based on my own Linux makefile
# Code is compiled with -D__USE_INLINE__ to have OS 3.x compatibility!
HOST = `type env:Hostname`
OSTYPE = Workbench `type env:Workbench`|Kickstart `type env:Kickstart`
PRG = NetMon
OBJS = main.o rsfuncs.o NetMon_rev.o
DEPS = includes.h structs.h NetMon_rev.h
#-----------------------------------------------------------------------------
CC = @gcc
#CFLAGS = -D__USE_INLINE__ -DCPU_TYPE="PPC" -O2 -Wunused -c
#LFLAGS = -lm
CFLAGS = -D__USE_INLINE__ -DCPU_TYPE="PPC" -O3 -Wunused -mcrt=newlib -c
LFLAGS = -lm -mcrt=newlib
RM = @Delete
ECH = @Echo
DIR = @List
COPY = @Copy
CLS = C:cls
#INCLUDE = -Isdk:Local/include
#INCLUDE = -ISDK:Local/Include
COMPILER = gcc `gcc -dumpversion`
STRIP = @strip
#-----------------------------------------------------------------------------
.PHONY: all clean full
all: cls $(PRG)
$(ECH) "all done.*N"
$(ECH) "Executable Size: " NOLINE
$(DIR) $(PRG) LFORMAT="%L Bytes"
$(ECH) ""
strip: cls
$(ECH) "Removing Symbols from $(PRG)*N"
$(ECH) "Size before strip: " NOLINE
$(DIR) $(PRG) LFORMAT="%L Bytes"
$(STRIP) $(PRG)
$(ECH) "Size after strip: " NOLINE
$(DIR) $(PRG) LFORMAT="%L Bytes"
$(ECH) "*NAll done.*N"
newlib: cls $(PRG)
$(ECH) "all done.*N"
$(ECH) "Executable Size: " NOLINE
$(DIR) $(PRG) LFORMAT="%L Bytes"
$(ECH) ""
$(PRG): $(OBJS)
$(ECH) "*NLinking..." NOLINE
$(CC) -o $(PRG) $(INCLUDE) $(OBJS) $(LFLAGS)
%.o: %.c $(DEPS)
$(ECH) "Compiling" $<
$(CC) $(CFLAGS) $(INCLUDE) $<
clean:
$(ECH) "Cleaning up:*N"
$(RM) $(OBJS) $(PRG)
$(ECH) "*NAll Done."
full: clean all
cls:
$(CLS)
$(ECH) "Compiling $(PRG) on $(HOST) [$(OSTYPE)] with $(COMPILER)*N"
#-----------------------------------------------------------------------------