forked from henkman/virgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (25 loc) · 849 Bytes
/
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
SRCS=virgo.c
OBJS=$(SRCS:.c=.o)
CFLAGS=-std=c89 -pedantic -Wall -O3 -nostdlib -fno-asynchronous-unwind-tables -fno-builtin -fno-ident -ffunction-sections -fdata-sections
LIBS=-lgdi32 -luser32 -lshell32 -lkernel32
LDFLAGS=-static -nostdlib -fno-builtin -s -Wl,-e,__main,--gc-sections,-subsystem,windows $(LIBS)
ARCH=32
ifeq ($(ARCH), 64)
WINDRES_ARCH=pe-x86-64
else
WINDRES_ARCH=pe-i386
endif
NAME=virgo
EXE=$(NAME).exe
.PHONY: all clean
all: $(EXE)
$(EXE): $(OBJS) $(NAME).res
$(CC) -o $(EXE) $(OBJS) $(NAME).res -m$(ARCH) $(LDFLAGS)
$(NAME).res: $(NAME).rc
windres -O coff -F $(WINDRES_ARCH) $(NAME).rc $(NAME).res
.c.o:
$(CC) -o $@ $(CFLAGS) -m$(ARCH) -c $<
clean:
rm -f $(OBJS) $(EXE) $(NAME).res
format:
astyle --mode=c --style=kr --indent=tab --pad-header --delete-empty-lines --align-pointer=name --max-code-length=80 virgo.c