aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile59
1 files changed, 59 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4815a84
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,59 @@
+CC := gcc
+CFLAGS := -O2 -g -Wall -ffunction-sections -fdata-sections -ffast-math -fomit-frame-pointer -fexpensive-optimizations
+LDFLAGS :=
+RM := rm -rf
+LIBS := -lcurses
+
+TARGETS := aes asciihexer dummyshell suidcmd
+
+ifneq ($(strip $(MAKE_NCURSES)),)
+TARGETS += gol
+endif
+ifneq ($(strip $(MAKE_X11)),)
+TARGETS += xidle
+endif
+
+
+all: $(TARGETS)
+
+%.o: %.c
+ @echo 'Building file: $<'
+ @echo 'Invoking: GCC C Compiler'
+ $(CC) $(CFLAGS) -D_GNU_SOURCE=1 -D_HAVE_CONFIG=1 -std=c99 -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+ @echo 'Finished building: $<'
+ @echo ' '
+
+
+aes: aes.o
+asciihexer: asciihexer.o
+dummyshell: dummyshell.o
+suidcmd: suidcmd.o
+ @echo 'Building target: $@'
+ @echo 'Invoking: GCC C Linker'
+ $(CC) $(LDFLAGS) -o "$@" "$<"
+ @echo 'Finished building target: $@'
+ @echo ' '
+
+gol: gol.o
+ @echo 'Building target: $@'
+ @echo 'Invoking: GCC C Linker'
+ $(CC) $(LDFLAGS) -o "$@" "$<" -lncurses
+ @echo 'Finished building target: $@'
+ @echo ' '
+
+xidle: xidle.o
+ @echo 'Building target: $@'
+ @echo 'Invoking: GCC C Linker'
+ $(CC) $(LDFLAGS) -o "$@" "$<" -lX11 -lXext -lXss
+ @echo 'Finished building target: $@'
+ @echo ' '
+
+clean:
+ -$(RM) aes.o asciihexer.o dummyshell.o gol.o suidcmd.o xidle.o
+ -$(RM) aes.d asciihexer.d dummyshell.d gol.d suidcmd.d xidle.d
+ -$(RM) aes asciihexer dummyshell gol suidcmd xidle
+ -@echo ' '
+
+rebuild: clean all
+
+.PHONY: all clean