-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (26 loc) · 664 Bytes
/
Makefile
File metadata and controls
38 lines (26 loc) · 664 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
# Makefile
# 2021-02-07 Markku-Juhani O. Saarinen <mjos@mjos.fi>
# Demo makefile for S-Box decomposition
# Cross compile for dosbox on Linux
XCOM = gostbox.com
NASM = nasm
# Regular C target
XBIN = xtest
CC = gcc
CFLAGS = -Wall -Wextra -O2 -g
#CFLAGS = -Wall -Wextra -Wshadow -fsanitize=address,undefined -O2 -g
CSRC = $(wildcard *.c)
OBJS = $(CSRC:.c=.o)
LDLIBS =
all: $(XBIN) $(XCOM)
# dos .com file is made from a single assembler file
%.com: %.asm
$(NASM) -f bin $^ -o $@
# standard Linux C compile
$(XBIN): $(OBJS)
$(CC) $(CFLAGS) -o $(XBIN) $(OBJS) $(LDLIBS)
%.o: %.[cS]
$(CC) $(CFLAGS) -c $^ -o $@
# cleanup
clean:
$(RM) $(XBIN) $(OBJS)