Skip to content

Instantly share code, notes, and snippets.

@racingmars
Created September 5, 2020 02:03
Show Gist options
  • Save racingmars/e1fab89de36941649872d4b8b2c2bf87 to your computer and use it in GitHub Desktop.
Save racingmars/e1fab89de36941649872d4b8b2c2bf87 to your computer and use it in GitHub Desktop.
Makefile for JCC compile and link on Linux, submitting to Hercules socket card reader
export WINEARCH = win32
CC=wine ../jcc/jcc.exe
INCLUDE=-I../jcc/include
LINK=wine ../jcc/prelink.exe
LOBJS=../jcc/objs
RDRPREP=../rdrprep/rdrprep
HERCHOST=localhost
HERCPORT=3506
TARGET = hello.jcl
TARGETLIB=hello.out
SRCS = hello.c
OBJS := $(SRCS:%.c=%.obj)
all: $(TARGET)
$(TARGET): $(OBJS) link.jcl
$(LINK) -s $(LOBJS) $(TARGETLIB) $(OBJS)
$(RDRPREP) link.jcl $(TARGET)
hello.obj: hello.c
$(CC) -o $(INCLUDE) hello.c
install: $(TARGET)
nc -w1 $(HERCHOST) $(HERCPORT) < $(TARGET)
clean:
rm -f *.obj $(TARGETLIB) $(TARGET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment