forked from zorts/hello_world
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (37 loc) · 642 Bytes
/
Makefile
File metadata and controls
47 lines (37 loc) · 642 Bytes
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
UNAME_KERNEL := $(shell uname -s)
UNAME_MACHINE := $(shell uname -m)
ifeq "${UNAME_KERNEL}" "OS/390"
OSTYPE := zOS
else
ifeq "${UNAME_KERNEL}" "Linux"
ifeq "${UNAME_MACHINE}" "s390x"
OSTYPE := zLinux
else
OSTYPE := Linux
endif
else
$(error "Unknown kernel type ${UNAME_KERNEL}")
endif
endif
EMPTY =
ifeq "${OSTYPE}" "zOS"
CC := c99
else
ifeq "${OSTYPE}" "zLinux"
CC := gcc -std=c99
else
$(error "Unknown OSTYPE ${OSTYPE}")
endif
endif
default: test
test: hello
./hello
./hello with some arguments
hello: hello.o util.o
$(CC) -o $@ $^
hello.o: hello.c
$(CC) -c -o $@ $<
util.o: util.c
$(CC) -c -o $@ $<
clean:
rm -f *.o hello